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 result links

September 26, 2007 5:10am

Subscribe [2]
  • #1 / Sep 26, 2007 5:10am

    cbis

    7 posts

    Hi,

    I’m using the search module on a site that I’m creating at the moment.  The search results page comes up as the default search result page - I haven’t changed anything yet. 

    When I search for blogs, I want to be able to insert them into a template as they would appear on the site.  Obviously, this involves several different templates depending on the area of the site the blog is appearing in, so the URL structure is different.

    Eg: path to blog 1:  template1/template2/blog1
        path to blog 2:  template3/template4/blog2

    Is there any way that I can make individual search result links specific to the where certain blogs can be found?

    I have a feeling the answer is no, because EE is tailored to be so dynamic. 

    Perhaps there’s a way around this?

  • #2 / Sep 26, 2007 12:06pm

    Robin Sowell

    13255 posts

    Do you mean the links to the individual article pages that will show on the search results page?  If so- the answer is ‘yes’- you can specify the ‘single entry’ page urls for search and comment links on a per weblog basis in ‘Admin- Weblog Admin- Weblog Management’.  Edit each weblog- check under ‘Paths’- basically, set the search/comment paths so they go to your single entry template for that weblog- and when used, EE will append the proper entry_id or url_title to that path.

    So- on the search results, you could then use {comment_url_title_auto_path} and get a different single entry page link based on weblog.  Most of the standard weblog variables are available for use in the search results tag- so you’ve got a lot of flexibility.

    Is that sort of what you’re going for here?  Or am I misunderstanding the issue?

  • #3 / Sep 27, 2007 10:17am

    cbis

    7 posts

    Hi Robin,

    I think I probably worded the question oddly…

    You’ve understood half of the problem though - assigning the different URLs to different weblogs.  I think the mistake I made though was that I used the word ‘blog’ instead of ‘entry’...

    So I guess the question really is - is there anyway to assign a URL based on the URL_title/specific entry within a weblog??  All my entries are in one weblog at the moment…is it a case of having to move some to new weblogs?? 

    Hope this makes it easier to understand.

    Thanks!

  • #4 / Sep 27, 2007 11:24am

    Robin Sowell

    13255 posts

    Generally, all of the entries in a given weblog will use the same template to display the single entries.  Unless you’re using the pages module?  In which case, the page url variable should do the trick.  But I suspect I still may not be fully understanding.  If that’s the case- a link with an example would probably help me narrow in on things.

  • #5 / Sep 28, 2007 7:31am

    cbis

    7 posts

    It seems that you’ve got it exactly - that’s exactly what I need.  I don’t have the pages module installed, so will have to look into that.  I suspect it may not solve the problem however, because some entries appear on a number of pages that are created dynamically based on the URL….

    I don’t have a URL I can give you to look at as the site isn’t up and running properly yet - it’s still in the testing phases unfortunately.

  • #6 / Feb 04, 2008 11:57am

    be-human

    48 posts

    Hi Robin,

    I have a weblog called ‘Products’ which has products in it. Each of these products are related to one of 4 fields: a,b,c or d. Depending on the product relationship, I need the search results to take me to a specific template. Is this possible? I can set the weblog path in the management section, but I can only specify one template for each weblog.

    Are there conditionals I can add to the search results page to say if the product is related to A then go to TEMPLATE-A, if related to be got to TEMPLATE-B etc…

    Thanks in advance.

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

ExpressionEngine News!

#eecms, #events, #releases