Tag search and CGBlog

Do something cool with CMS? Show us ...
This board is for 'Answers', and the discussion of answers... Not for questions.
Post Reply
User avatar
Gregor
Power Poster
Power Poster
Posts: 1872
Joined: Thu Mar 23, 2006 9:25 am
Location: The Netherlands

Tag search and CGBlog

Post by Gregor »

Based on the description in this topic viewtopic.php?f=4&t=80640 I modified the 'Search Results template' to:

Code: Select all

<h3>{$searchresultsfor} "{$phrase}"</h3>
{if $itemcount > 0}
<ul>
  {foreach from=$results item=entry}
  <li>{$entry->title} - <a href="{$entry->url}">{$entry->urltxt}</a> ({$entry->weight}%)</li>
    {if $entry->module == 'CGBlog'}
        {CGBlog action="default" summarytemplate='blogSummary_LeftRight' articleid=$entry->modulerecord detailpage='logboek'}
    {/if}
  {/foreach}
</ul>

<p>{$timetaken}: {$timetook}</p>
{else}
  <p><strong>{$noresultsfound}</strong></p>
{/if}
The code above stops with a fatal error after 30seconds. Is the snippet above the way to use the CGBlog summary template to show the to the search related records, or do I have to mix the code from the summary template into the search results template?
User avatar
Gregor
Power Poster
Power Poster
Posts: 1872
Joined: Thu Mar 23, 2006 9:25 am
Location: The Netherlands

Re: Tag search and CGBlog

Post by Gregor »

gentle kick...
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3315
Joined: Mon Nov 28, 2011 9:29 am
Location: The Netherlands

Re: Tag search and CGBlog

Post by velden »

Although I doubt it will cause the fatal error it seems a little strange to call CGBlog's default action (which usually is a summary action) and supplying an articleid parameter.

I'd expect it should be the 'detail' action and detail template.
User avatar
Gregor
Power Poster
Power Poster
Posts: 1872
Joined: Thu Mar 23, 2006 9:25 am
Location: The Netherlands

Re: Tag search and CGBlog

Post by Gregor »

Thanks Velden.

These parameters seems to be in conflict with each other.

Basically what I what to achieve is show the summary template for each cgbolg article record that matches the search. {CGBlog action="default" summarytemplate='blogSummary_LeftRight'} will probably perform action on all cgblog records.

Any suggestions on how to only show the searched records in the summarytemplate view?
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3315
Joined: Mon Nov 28, 2011 9:29 am
Location: The Netherlands

Re: Tag search and CGBlog

Post by velden »

I quickly scanned CGBlog help and didn't find a way to provide multiple article ids to this module.

I guess you will have to create a detail template to mimic the behavior of the summary template (though this can be a challenge because the detail template isn't usually used to start and end a series of items (opening and closing a div for example) and it also will be harder to implement a left/right solution (the template name makes me think your doing something like that).

Pagination will also be a problem.
User avatar
Gregor
Power Poster
Power Poster
Posts: 1872
Joined: Thu Mar 23, 2006 9:25 am
Location: The Netherlands

Re: Tag search and CGBlog

Post by Gregor »

You're right on the left / right lay-out.

I think the solution would be to collect the multiple id's based on the search and feed these to the cgblog summary template. Easier said than done....
Post Reply

Return to “Tips and Tricks”