[solved] random content out of a category, help needed
[solved] random content out of a category, help needed
Hi Guys,
I've been searching through the forum for days. I have found hacks that come close, but i think none actually fits.
The idea is a random testimonial, it shows the summary and (sub)title of a random article in a category named "testimonials". In a second template, it shows random out of category "testimonials NL".
Is there anyone that can adapt an existing RT hack, or create a new one to work like this?
Below a screenshot of how it should work.
Looking forward to an idea, since i really have no clue how to solve this without having to tell my client that he cant manage the testimonials since its an external script displaying them.
Thanx in advance!
Seb
I've been searching through the forum for days. I have found hacks that come close, but i think none actually fits.
The idea is a random testimonial, it shows the summary and (sub)title of a random article in a category named "testimonials". In a second template, it shows random out of category "testimonials NL".
Is there anyone that can adapt an existing RT hack, or create a new one to work like this?
Below a screenshot of how it should work.
Looking forward to an idea, since i really have no clue how to solve this without having to tell my client that he cant manage the testimonials since its an external script displaying them.
Thanx in advance!
Seb
Last edited by seb-nl on Thu 22. Jun 2006, 14:04, edited 2 times in total.
I think teaser_ex can handle this....
The tag may look like this:
{TEASER_EX:testimonials|1:1:rand():0::1:13:mytemplate.tmpl}
More info at:
http://www.phpwcms.de/forum/viewtopic.php?t=7503
Let me know if you need further assistance...
Erich
The tag may look like this:
{TEASER_EX:testimonials|1:1:rand():0::1:13:mytemplate.tmpl}
More info at:
http://www.phpwcms.de/forum/viewtopic.php?t=7503
Let me know if you need further assistance...
Erich
The above RT is a sample only...seb-nl wrote:Hi Erich,
It doesn't work.
This is the exact rt i used:
{TEASER_EX:testimonials|1:1:rand():0:1:13:mytemplate.tmpl}
+front end init is on since i use dhtmldropdown.php which is working fine.
+the cat. exists en has 3 articles in it
Any ideas?
Thanx
/seb
Try this one:
{TEASER_EX:testimonials|1:1:rand():0:1::sample.tmpl}
(if there is no template named "mytemplate.tmpl" in "phpwcms_template\inc_cntpart\articlesummary\list" it will not work..., so try sample.tmpl)
Erich
Great!
It works!!
Thank you so much!
There's only one thing. Even though I've setup mytemplate.tmpl, like so:
<p class="rtestcomma">{SUMMARY}</p>
<ul>
<li class="rtestref">{SUB}</li>
<li class="rnewslinksli"><a href="index.php?testimonials" class="rnewslinks">more testimonials</a></li>
</ul>
It keeps wrapping your 'template' around it:
<!-- START NEWS TABLE -->
<table id="teaserTable"><tr><td id="teaserTableLeftCell" valign="top" width="100%"><p class="rtestcomma"><p><font color="#000000">Managing phone costs of our forresters is as easy as tearing an fifteenyears old oak down.</font></p></p>
<ul>
<li class="rtestref">Boris Eikelhoofd, CEO WestBosbeheer</li>
<li class="rnewslinksli"><a href="index.php?testimonials" class="rnewslinks">more testimonials</a></li>
</ul></td></tr></table>
<!-- END NEWS TABLE -->
How do i prevent this from happening? search it up in the .php or give some sort of parameter?
I used this RT: {TEASER_EX:testimonials|1:1:rand():1::1::mytemplate.tmpl:0:2:70}
/seb
It works!!
Thank you so much!
There's only one thing. Even though I've setup mytemplate.tmpl, like so:
<p class="rtestcomma">{SUMMARY}</p>
<ul>
<li class="rtestref">{SUB}</li>
<li class="rnewslinksli"><a href="index.php?testimonials" class="rnewslinks">more testimonials</a></li>
</ul>
It keeps wrapping your 'template' around it:
<!-- START NEWS TABLE -->
<table id="teaserTable"><tr><td id="teaserTableLeftCell" valign="top" width="100%"><p class="rtestcomma"><p><font color="#000000">Managing phone costs of our forresters is as easy as tearing an fifteenyears old oak down.</font></p></p>
<ul>
<li class="rtestref">Boris Eikelhoofd, CEO WestBosbeheer</li>
<li class="rnewslinksli"><a href="index.php?testimonials" class="rnewslinks">more testimonials</a></li>
</ul></td></tr></table>
<!-- END NEWS TABLE -->
How do i prevent this from happening? search it up in the .php or give some sort of parameter?
I used this RT: {TEASER_EX:testimonials|1:1:rand():1::1::mytemplate.tmpl:0:2:70}
/seb
seb-nl wrote:Great!
It works!!
Thank you so much!
There's only one thing. Even though I've setup mytemplate.tmpl, like so:
<p class="rtestcomma">{SUMMARY}</p>
<ul>
<li class="rtestref">{SUB}</li>
<li class="rnewslinksli"><a href="index.php?testimonials" class="rnewslinks">more testimonials</a></li>
</ul>
It keeps wrapping your 'template' around it:
<!-- START NEWS TABLE -->
<table id="teaserTable"><tr><td id="teaserTableLeftCell" valign="top" width="100%"><p class="rtestcomma"><p><font color="#000000">Managing phone costs of our forresters is as easy as tearing an fifteenyears old oak down.</font></p></p>
<ul>
<li class="rtestref">Boris Eikelhoofd, CEO WestBosbeheer</li>
<li class="rnewslinksli"><a href="index.php?testimonials" class="rnewslinks">more testimonials</a></li>
</ul></td></tr></table>
<!-- END NEWS TABLE -->
How do i prevent this from happening? search it up in the .php or give some sort of parameter?
I used this RT: {TEASER_EX:testimonials|1:1:rand():1::1::mytemplate.tmpl:0:2:70}
/seb
Comment out
line 432, 439-443, 617
Parse error: syntax error, unexpected '}' in D:\xampplite\htdocs\phpwcms_template\inc_script\frontend_render\reptag_teaser_ex.php on line 630
Errrr.... Commented out as you said but now this happens.
Here's the file (lines 432-end):
Errrr.... Commented out as you said but now this happens.
Here's the file (lines 432-end):
Last edited by seb-nl on Thu 27. Jul 2006, 09:43, edited 1 time in total.