ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Change {search_path}

August 28, 2012 3:12pm

Subscribe [2]
  • #1 / Aug 28, 2012 3:12pm

    okenathan

    42 posts

    In the member profile pages you can click on the link “view all posts by this member”.

    This gives me a link to search/results (like this: http://www.myexample.com/search/results/unreadablesearchstring)

    However i changed the name of the search template to dutch which unfortunately gives me a 404.
    I totally understand the 404 and would like to change the path. But where?

    Where do I change the search path for the member module?

    Example links:
    Standard search path:
    http://www.myexample.com/search/results/unreadablesearchstring
    Dutch search path:
    http://www.myexample.com/zoek/resultaten/unreadablesearchstring

    The nice thing is, if i change the segments in the 404 generating page to the dutch words, everything works.

    So. How do i change the search path for the member section of my site?

  • #2 / Aug 29, 2012 12:12pm

    Shane Eckert

    7174 posts

    Hello ntr1,

    Thank you for posting your question here on the ExpressionEngine forums.

    Trying to change the way that search_path works may not be the way to go. You could hard code a path or define a global variable and then edit public_profile.html in the themes folder under “themes/profile_themes/default” to get the results you are looking for.

    Look for the following line.

    <div class='itempadbig'><a href="http://{search_path}"><b>{lang:view_posts_by_member}</b></a></div>

    I hope this helps!

    Cheers,

  • #3 / Aug 29, 2012 12:52pm

    okenathan

    42 posts

    Hi Shane,

    Thanks, that’s exactly what i’d like to do.
    However, since {search_path} automatically gives me a working but unreadable search string (right after http://www.site.com/search/result) i’d need to now how to add the unreadable search string to my custom url.

    This is what happens.
    EE creates a search path to site.com/search/results/searchstring
    I need the path to go to site.com/zoek/resultaat/searchstring

    How can i explain the “searchstring” part to expression engine?

  • #4 / Aug 30, 2012 11:28am

    Shane Eckert

    7174 posts

    Hey ntr1,

    Unfortunately if it’s not a language key, you cannot change it.

    A few ideas though.

    Transcribe might work for you here, it’s the most popular multi-language Add-On.

    Freebie will let you play with the segments.

    Router plays with url’s.

    One last idea is to use htaccess to rewrite for you. I am not sure how you would do that, htaccess is like vodoo magic at times, but I would love to move this over to the Community Help Forum for you if you would like to explore that more.

    Sorry I cannot be of more help to you.

    Please let me know if there is anything else I can help with.

    Cheers,

  • #5 / Aug 30, 2012 12:16pm

    okenathan

    42 posts

    Hi Shane,

    I thought of .htaccess before posting the question.
    I was hoping for an EE solution.

    For future reference… This works fine:

    RewriteRule ^search/results(.*)$ http://www.mysite.com/zoek/resultaat$1 [L,R=301]

    Thanks!

     

  • #6 / Aug 30, 2012 12:20pm

    Shane Eckert

    7174 posts

    Hey ntr1,

    Awesome. Thanks for sharing that, I am sure someone will benefit from it in the future. Hey future self, who wins the series?

    I would like to have given you something native, but it’s just not there at the moment.

    Thanks again for the question!

    If you need anything else, please just let me know by opening a new thread.

    Cheers,

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases