Why there is "tag" Showing in my ULR, I want to remove it - tags

This is https://www.theblogarticle.com/tag/best-greenhouse-kits, I have written a post on Greenhouse gasses effect.
so please let me know how I can make it like https://www.theblogarticle.com/best-greenhouse-kits

Related

Redirect to last page when overlay comment-form is used

I've got a view (phase4) with some custom content type content in it, where the users may comment on.
When the users want to comment, the comment form should appear in a modal form. I solved this by using the admin overlay.
Adding following function to my custom module:
function phase2_admin_paths_alter(&$paths) {
$paths['comment/reply/*'] = TRUE;
}
and using following link:
Comment
to open the comment form in a modal way. So far so good... but....
How do I redirect the user back to the page, the user was coming from.
I know that I have to overwrite the #action of the form in the template_form_FORMID_alter, like
$form['#action'] = $lasturl;
but how do I get the last url, so that it is reusable (so hardcoding the url isn't an option)?
My first idea was that I transfer the last url by adding it to the url as a $_GET-parameter, but it looks like this:
www.example.com/phase4#overlay=comment/reply/161%3Furl%3Dphase4
I also tried it with drupal_get_destination(), but either with no success, because of the tranformation of the "?" and the "=" in the url.
Are there other ways to find out where the user was coming from?
Note: phase4 isn't the alias of node 161. Phase 4 is a view, where node 161 is an element of.
Cheers
Tom
You have to use the drupal_get_destination() function with l() function to create such links.
$destination = drupal_get_destination(); // Store current path
Comment

CQ5.5: getting Style of a target page

I've been working on this for sometime now, and I keep running into a wall. I think I'm close, but I figured someone out here in the land of SO might have some deeper insight if not a better way of doing what I'm trying to do.
Basically lets look at this scenario. I have a logo w/ some text that can be set from a few different places. If we look at the setup here is what it looks like.
Hiearchy:
Homepage [has designPath]
- Child Microsite Page [has designPath]
- Logo Component
Logic Flow (in logo component):
if properties.get("logoText") {
use this
} else if currentStyle.get("logoTextFromStyle") {
use this
} else if parentStyle.get("logoTextFromGlobal") {
use this
} else {
be blank
}
My query is with how to get the "parentStyle" of this page. Looking at the docs here: http://dev.day.com/docs/en/cq/5-5/javadoc/com/day/cq/wcm/api/designer/Style.html
I've been able to come up with the fact that I can get a Style object from the "designer" object made available via defineObjects. This is defined with the other utility objects like "pageManager, resourceUtil, resource, currentPage, etc".
With that being said this doesn't seem to work.
//assuming we have getting homePage earlier and it is a valid cq Page resource
Resource homePageResource.slingRequest.getResourceResolver().getResource(homePage.getPath());
Style homePageStyle = designer.getStyle(homePageResource);
at this point homePageStyle is null. To do some more testing I i tried passing currentPage.getPath() instead of homePage.getPath(). I assumed this would give me the currentPage resource and would in end yield the currentStyle object. This also resulted in a null Style object. From this I think I can safely conclude I'm passing the incorrect resource type.
I attempted to load the the cq:designPath into the resource hoping to get a Designer resourceType but to no avail.
I am curious if anyone has run into this problem before. I apologize if I've gone into too much detail, but I wanted to lay out the "why" to my question as well, just in case there was a better way overall of accomplishing this.
I've figured out how to return the style. Here is the rundown of what I did.
//get your page object
Page targetPage = pageManager.getPage("/path/to/target");
//get the Design object of the target page
Design homePageDesign = designer.getDesign(homePage);
//extract the style from the design using the design path
Style homePageStyle = homePageDesign.getStyle(homePageDesign.getPath());
it's very interesting the definition of "getStyle" is a little different from the designer.getStyle vs a Design.getStyle. designer.getStyle asks for a resource whereas Design.getStyle will take the path to a Design "cell" and return the appropriate Style.
I did some testing and it looks like it does work with inherited Styles/Designs. So if my cq:designPath is set at level 1 and I look up a page on at level 2 they will return the Design/Style at the cq:designPath set at level 1.
I hope this helps someone else down the way.
I tried this approach but was not getting the Styles in the Style object.
When we do this:
Design homePageDesign = designer.getDesign(homePage);
In this Design object we get the path till the project node i.e etc/design/myproject
After this if we try to extract the Style from the design path we do not get it.
However I implemented it in a different way.
In the design object, we also get the complete JSON of designs for(etc/design/myproject).
Get the sling:resourceType of the target page and get the value after last index of "/".
Check if this JSON contains the last value. If it contains, you can get your styles, i.e. image, etc.

can any one tell me how to access my parsed xml object

i have this parsed object
$xmlObj = new SimpleXMLElement($XMLToParse, LIBXML_DOTTED_VERSION, FALSE, "http://SOME/schema/universal_v17_0");
that has the stucture like this inside it
<universal:UniversalR LocatorCode="somecode" Version="2" Status="Active">
<common_v17_0:Book Key="some" TravelerType="some">
so i can access the first element(its attributes) like this $VariableX=$xmlObj->UniversalR->attributes();//then $VariableX["Status"];
but when i want access his child i cant $tm=$xmlObj->UniversalR->Book->attributes();
it doesnt want to enter probably because of the different namespace...can any one help me . THX
I found something here http://blog.sherifmansour.com/?p=302
foreach ($xmlObj->UniversalRecord as $entry){
$namespaces = $entry->getNameSpaces(true);
$cmm = $entry->->children($namespaces['common_v17_0']);
$aa=$cmm->Book->attributes();
echo $aa["TravelerType"]."ddddd";
}
That should do it :)
$tm=$xmlObj->UniversalRecord->Book->attributes(); is this typo (UniversalRecord instead of UniversalR) only present in this post or is it also present in your code?
(I'd have liked to post this as a comment.. but it looks like i'm not allowed to, or am too stupid to find the button. :/)

Eclipse auto completion: How to show only those methods with a specific pattern/wildcard?

I often know only parts of a method, I would like to call, but not the whole name (especially not the beginning).
So I'd like to know, if there is a possibility to type in a pattern/wildcard while auto completion is active.
Thanks in advance!
// I'd like to call str.toUpperCase() but imagine I don't know that it starts with to
String str = "some string";
str.*upper // sth like that while auto completion is active
See also
Using Wildcards with Content Assist in Eclipse

facebook - remove people you may know

I'm just getting into facebook now. That "people you may know" section that pops up is driving me to distraction, and I'm just trying to get rid of it.
I have a greasemonkey script but its not working. None of numerous posted Greasemonkey scripts to remove it work either.
In the source for the facebook page , the "People You May know" (PYMK) section is in a script element that contains just one very long function call, i.e.
<script>big_pipe.onPageletArrive({"phase":1,"id":"pagelet_ego_pane","is_last":true,"css":["30YXW","MA+x5"],"js":["uBXoU","LNwoY","NavLF","ZtuLL"],"onload":["window.__UIControllerRegistry[\"c4dc09ff06275f0732488206\"] = new UIPagelet(\"c4dc09ff06275f0732488206\",
...
So I'm just trying to remove that script element and I tried this as a first pass:
function Remove_PYMK() {
var scripts = document.getElementsByTagName('script');
for (n=0; n<scripts.length; n++) {
if (scripts[n].innerHTML.indexOf("People You M") >=0) {
scripts[n].style.visibility="hidden";
alert ("found it");
}
}
}
Remove_PYMK();
//document.addEventListener("onload", Remove_PYMK, true);
It finds it, it just doesn't remove it.
This is something of a kludge, needless to say. Is there a proper way to disable PYMK, and ALSO, prevent my name from showing up in PYMK on other people's page.
EDIT:
Here's the entire script node up until the string "People You May Know" (FWIW):
<script>
big_pipe.onPageletArrive({
"phase": 1,
"id": "pagelet_ego_pane",
"is_last": true,
"css": ["30YXW", "MA+x5"],
"js": ["uBXoU", "LNwoY", "NavLF", "ZtuLL"],
"onload": ["window.__UIControllerRegistry[\"c4dc09ff06275f0732488206\"] = new UIPagelet(\"c4dc09ff06275f0732488206\", \"\\\/pagelet\\\/generic.php\\\/WebEgoPane\\\/\", {}, {});; ;", "new EmuController(\"6002939839588-id_4dc09ff0611f60c83869379\", \"AQBsgeDBRnJ4uiUuieZs681Fm3aqB5-626iHBbItdNfF5TWZZJ-9dZ60xyVaJr7JfimJpKgKNxXqF_DH_aHjru3RItUcHs2gI_ZLQNYdIENRSM5zh_pcjiDZyN7vv0trj5UDBOfXp6A6yDdVCZDLntgw1fU3cFSjPQkk9KQHnU3B61bkLQfoyQzysiefB82Ptf7tgkHDqlDwNpUT-HhYPOr8yGKxD6XavtgIfsW9hLPfGy6Eg7POsGHDyXrIDrl-Q3HM2CPoByeL43H0wIklCdbe8Oi3VnfKa-ysGjLB8YuAZHOJ1GH9feOxFphmcHE5C1R15rcPdnXSOaBI5bIJdJ24pIfAlNmGjXSMHU5LOiBm3FvCi_WzotJKxeRPjMBRmqQXw2CJ-xhFGGFqGRfJvoa9m8XKb1YpXzx-pqcpzDJ1z2xz3TT7gvObi5U-9ZaRtzNHY5g0UI3W-JeYjC-67Ir74mltDpXojdx-fWG5c-3OoX5bNJrCh1ifbQKFn3wLDAMdUHk4h8GO5eJdP_1xvJFal0SWZnwnMbty2AAd7EeFcSQNkjdK9BViqFo7OLLh8tT-j9k1fNnccza4M9jN94NEEjXRxU2KYhSGjdKL0fMJCfYA1y-3MMi7WbwEg7QiH-0AY_vQCu75j7vBtrwhjVpIK4kpBpNLYx5ucqLMe1RXt3PkE-xY0Jr5LRtwDq6MjeLrCjP0JaBL9o55o2DGPN-MNndM5YSCiZbri6ms7kJ0DADuZxiWkZDISrZlE_RZ4-8\", 4, 0)", "new EmuController(\"6003087448525-id_4dc09ff0612184c51197177\", \"AQAVDQezDWg8RCTH6EnPLCILHIX4upfP5v0NJ_-npYstbN0e4SWpCrfbYAQRM_9dVfozxS89XSxUt1jgEQpRbTHE3sfkcngkwyKIjKGhmIS8rKfDX_gP4ER0NnVJlJyX6FaGRul0h2UUYxnxj3uaIsq7LzcI36r4lBTXBg1THtRC2pZ1MuUzvkTlYlwh4B-c5lXwt-6nKTTMdoZsTRsUDG_JTAPHeTV0-FYMr-1roaJpR_j--aw_MxJ6NxFEbTvkyL4QVN-ZRpWfeovChdYk4j_cgxoxRE-qm-u_hYcVbbtVrQXq0kVtHHhX8ijyeLt-4kZcM6gfnHpfBkB06z69adcA9rzWLA6VEo4_OFthPtc2SydkBs6DyAx51mAG3mBgnXXBJciYrQzWM-vSvODcV1dKTb5tSxO81Uswl-3Uo9Jf_VzfUgoKdeHyQeem31WMUmYm9kxCOVvKy4p7sE09GQoAfPBoz4MOrAgs3MFBFzpwIvKyZGvE6cX8haiK4POdP1zrEnMLFDyF0HRAaxfl4gKYw9kpGOtkrwezzU_biPYxV26-sUjXvPGx87WAZszqlIosXOJVux33eJD3V5bDcFD06Faze9OE5Segl4Tdmd0VZs73lt4PGXfF90QLCqZeUuNUUCkhRRRsP99SdW99Ghx0JncIQDpfX3fByce58jmKSCFWjcHy5qTPlryVI3KVow-XMLiguVmdbicCBGq-7im00hCmjH2-5HCuQnhHafNHUSZzZiHTg4KaTqvIMTfQIXs\", 4, 0)", "new EmuController(\"6003788660296-id_4dc09ff0612299683640305\", \"AQCvUWOfDiphu5NGe7r6dBna_IEvTbjrshIpxmOlMO3jwk650AHb_T03II0mnzLwpdy617kQMD8n8RIE_YqIE1hNxxoZL4M4ba8QiPz6h-u003c\/h4>\JW8WSPFBt1RSMeJQV7swF6HWeAm3Ew0fphxMwpdYDIu2fbEGLujVFCKwtMCzN6As6berB8z7iOoWdsAF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iGED7yL7p1CKAKgJcO4jzmJ3Epk9tK38zy3Nv5yGB0-63dwjcvZMoTJMa545d2Vgs7J5_OiD6gA5fX4oB84m1dcI5e2G6AgzXAsWTUSuIGliPQr2oFjaz2mOzepyCvoatPjr1rtDkX_xNK9S27jXSuu9k0tiKCOkPsdccPO6235zCT0HeiPI0sHsUTpDmiFXHyFx0r_Kus5iCU5CjKjX1okSuKQL7WM5HTBvYRCAbPNthqa9oNDDNmwNG-Im7wNZHEw4ZZuXpqg4UolyUZAkY7dKBRvGmK0sSGSIjIISOq1e6zBdekf7OlZ5yLnCwhAI_5E\", 4, 0)"],
"onafterload": ["new EmuTracker(\"6002939839588-id_4dc09ff0611f60c83869379\", false)", "new EmuTracker(\"6003087448525-id_4dc09ff0612184c51197177\", false)", "new EmuTracker(\"6003788660296-id_4dc09ff0612299683640305\", false)", "new EmuTracker(\"6002985380734-id_4dc09ff06123a8641112115\", false)"],
"refresh_pagelets": ["c4dc09ff06275f0732488206"],
"content": {
"pagelet_ego_pane": "\u003cdiv id=\"c4dc09ff06275f0732488206\">\u003cdiv class=\"ego_column egoOrganicColumn\">\u003cdiv class=\"ego_section\">\u003cdiv class=\"uiHeader uiHeaderTopAndBottomBorder mbs uiSideHeader\">\u003cdiv class=\"clearfix uiHeaderTop\">\u003ca class=\"uiHeaderActions rfloat\" href=\"\/l.php?u=\u00252Ffind-friends\u00252Fbrowser\u00252F\u00253Fref\u00253Dpsa&h=1ef37&cb=3&p=AQCicK3gLdJTaaW2xZUw3DWp7N89P5QwZvSEfn3y2vOqjXyzr60nDcHEPY7Y9x7LpK9-J5evLB7_Dwm9F4d0k5i9sQ-CXiH_GXc-toIfka4dUSK_\">See All\u003c\/a>\u003cdiv>\u003ch4 class=\"uiHeaderTitle\">People You May Know\u003c\/div>
That GM script is not removing the script node, it is just "hiding" it -- which would never have an effect.
It is possible for GM to actually remove that script node but, alas, this will not happen before the node has run. Deleting it after that will not stop the operation, as the JS is already loaded into memory.
The easiest thing to do is to delete the container that is displaying the PYMK cruft.
I don't use Facebook, but from your code it appears that the container might have the id, "pagelet_ego_pane". In which case, you could delete it like:
var PYMK_Container = document.getElementById ('pagelet_ego_pane');
if (PYMK_Container) PYMK_Container.parentNode.removeChild (PYMK_Container);
You could also try to delete the annoying function, which may or may not be possible. The function appears to be set with that new UIPagelet(\"c4dc09ff06275f0732488206\" code. So, if you can find the corresponding function, you can try deleting it with:
unsafeWindow.OffendingFunctionName = function() { return; }
If that works, it may cut down on the JavaScript "churn" that might slow down that page.
As for stopping your name from showing up in other people's PYMK, that is something that is done by the Facebook servers, there may be a user setting that they have, otherwise you'll have to send Facebook a "sternly worded letter". ;)
A simpler way to do it would be to just add a user style sheet that hides the offending nodes, no javascript necessary.
However if you want a simple method that just works "out of the box" for hiding the "People You May Know" box, the FB Purity browser addon (also available as a greasemonkey script ) has an option for hiding the PYMK box, along with options for hiding most other boxes / links on the site.