drupal 7 create an alias view alias with arguments - .htaccess

I have an url like this:
http://www.mysite.com/myview?arg1=3&arg2=4.
It points to a view.
I would like , for a specific compination of arguments, a shorter url alias
something like http://www.mysite.com/myalias that point to the same page.
I did try to add an url alias on drupal cms by here admin/config/search/path/add or by htaccess,
but I think I think to do that I need the "real" url of the view (the one that doesn't use Path auto, I guess)
Does someone know how to retrieve it?
or anyway does anyone know how to solve this issue?
thanks a lot!

I think this module helps you: https://drupal.org/project/views_url_path_arguments
It has not a final version, but I think you might find it useful.
Regards.

Related

ModX friendly url has a bad format

Sorry, this is probably a very basic question, but I'm new to ModX and haven't been able to find an answer.
I am trying to get friendly urls working, but right now, all my urls are showing up like
http://localhost/modx/modx-2.2.13-pl/"http://localhost/modx/modx-2.2.13-pl/other.html
instead of the expected
http://localhost/modx/modx-2.2.13-pl/other.html
I probably don't have some system setting set correctly; any help would be greatly appreciated...
Sounds like you've forgotten to add
<base href="[[++site_url]]" />
To your head.
At least that is the first thing that comes to mind.
Sounds like you're generating the links with full path, are you doing them yourselves or is it Wayfinder or some snippet? And why do you have a " there in the middle of the string?
The basic idea is to use a base_href consisting of your root, http://localhost/modx/modx-2.2.13-pl/, and then construct links like [[~[[+idToPageYouWantToLink]]]].

How to tell MODX wayFinder to detect the resource ID it is currently on

I am new to WayFinder but I have been working with it a bit and it has worked great for me, However I need something a little more dynamic that I'm not sure how to do.
I have a set of 5 pages in my website and each page has another side menu, but each menu for all five resources will be slightly different
I need wayfinder to detect what the current ID is and then display the appropriate menu
I've tried a couple things but nothign i can get to work:
[[!If? &subject=[[*28]] &then=[[Wayfinder? &startId=27&excludeDocs=28,29,30,31,32,33,89]]]]
So I need to say if the ID is = to 28 display this menu if the ID is = to 29 display this one and so on.
I've also tried &idIs=28 and a couple other variations but couldn't really find anything to help me out on this Does anyone else have any ideas how to make this work? Thank you.
With the solution typeset suggest, wayfinder will be called each time thereby causing uneeded loading time to your site. This will be faster because wayfinder only will be called when id = 28.
[[[[*id:is=`28`:then=`Wayfinder? &startId=27 &excludeDocs=28,29,30,31,32,33,89`:else=``]]]]
Read more on it here: http://modx.com/blog/2012/09/14/tags-as-the-result-or-how-conditionals-are-like-mosquitoes/
You can use output filters for conditional calls. Documentation for them is here
You code would looks something like this:
[[*id:is=`28`:then=`[[Wayfinder? &startId=27&excludeDocs=28,29,30,31,32,33,89]]`:else=``]]
If the menu needs to start from the current ID then you'd use
&startId=`[[*id]]`
If you want it to show all the resources in the current folder, you can use UltimateParent, so
&startId=`[[UltimateParent]]`
Hope this helps!
This should work. The subject is just the parameter you are comparing it against so it shouldn't contain the value.
[[!If?
&subject=`[[*id]]`
&operator=`EQ`
&operand=`28`
&then=`[[Wayfinder? &startId=`27` &excludeDocs=`28,29,30,31,32,33,89`]]`
]]

GWTP Hiding the parameters from the URL

Is it possible to hide the parameters from the URL?
placeManager.revealPlace(new PlaceRequest("show").with("t", "e").with("x", "1"), true);
URL:
gwt.codesvr=127.0.0.1%3A9997#show;t=e;x=1
I want the URL to be gwt.codesvr=127.0.0.1%3A9997#show. Is this possible? or any other approach to do this?
I tried passing an event.. But the URL doesnt change in that case.
Thanks,
Pradeep
It is not possible in GWTP to hide parameters of Place(Request)s because a Place represents a state in the browser History and has to be (de)serializable into/from URL's.
I can't give you a good recommendation for a workaround because I don't know your architecture. If you like is dirty just use static fields which you initialize before revealing the place.

What's the recommended approach for hierarchical URLs in Orchard?

I'd like to have a hierarchical URL structure in my site. Something on these lines:
tutorials
javascript
jquery
There should be a page at each level (tutorials, tutorials/javascript and tutorials/javascript/jquery). Obviously, using Taxonomies would help me organize my content in this manner, but how do I get Autoroute URLs generated for this scenario?
Bertrand Le Roy made a comment on this SO answer about using taxonomy terms as pages but it still doesn't seem to create the right URL structure for me. Am I missing something? Is there something specific I need to configure or enable to make this happen?
Are there any other approaches I can look at?
I was thinking of specifying the default route as something like {Content.Fields.Page.TaxonomyName}. It appears that this isn't really possible right now according to this bug report.
Here's an approach that seems to work without having to use taxonomies:
I added a Content Picker field called ParentPage to the Page content type and updated the Page's Autoroute default to
{Content.Fields.Page.ParentPage.Content.Path}/{Content.Slug}
Now in each page I get to pick what the parent page is and the URL is constructed how I expect it. From what I remember of working with WordPress, I think this is pretty close to how it allows you to do this parent page thing, too.

question title in url like stackoverflow

Id like to make a url similar to stackoverflow where the user can type in a textbox and then on refresh a url is created. like the url to this question uses the title i typed in. id like to make that effect on my own site. thanks. I think this may have to incorporate a .htaccess file??
You may notice that the words from the title in the question URL don't affect where the URL goes. The following link goes to the same place: https://stackoverflow.com/questions/6366169/foo-bar-baz
All you need to do is make your server process respond to the URL in the correct way. How you do this will depend on your chosen server architecture and/or programming language. Using .htaccess is unrelated.
maybe this link will help you understand how you can achieve your goal https://docs.djangoproject.com/en/dev/topics/http/urls/ (django)
http://www.phpaddiction.com/tags/axial/url-routing-with-php-part-one/ (php)
other web frameworks operate in similar way
in the given example you can interpret the url http://stackoverflow.com/posts/9701416/edit like this:
if you find "posts" in the url the next part of the url (9701416) is a parameter and the last part is the action so your main controller will load a post with id 9701416 and it will be loaded in edit mode (it doesn't mean there's a sub directory questions with sub directory 6366169 with a file "post")

Resources