Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Dynamic gallery only on homepage?
Hello to txp experts!
My question is how to make jQuery images appear only on the home page of the blog, not on any other? It is easy if homepage has one article like on regular sites, but if it is a blog it is a challenge. Аn example here – http://buyhomebc.com – the gallery is on prev. pages as well as on the home page which should not be.
Thanx in advance!
Offline
Offline
Re: Dynamic gallery only on homepage?
Thanx a lot. I felt it was something about if-else-thing.
Offline
Re: Dynamic gallery only on homepage?
jsoo wrote:
soo_if_frontpage is one solution.
one more thing, a really nice plug-in, but is there any example of using it? it is kinda tough to figure out what goes inside
<txp:soo_if_frontpage>
<txp:something />
<txp:else />
<txp:who-knows-what />
</txp:soo_if_frontpage>
???
is it kosher to put this
<txp:soo_if_frontpage>
<txp:output_form=“gallery” /????
<txp:else />
?????
</txp:soo_if_frontpage>
thanx in advance to all who can help!
Offline
Re: Dynamic gallery only on homepage?
admi wrote:
is it kosher to put this
Sure, and you don’t need to include the <txp:else />
unless you want something that appears only on pages other than the homepage. So:
<txp:soo_if_frontpage><txp:output_form form="gallery" /></txp:soo_if_frontpage>
is probably all you need. (Note the correct use of the output_form
tag.)
Code is topiary
Offline
Re: Dynamic gallery only on homepage?
jsoo wrote:
<txp:soo_if_frontpage><txp:output_form form="gallery" /></txp:soo_if_frontpage>
it duznt work, altough it is logical. i created an empty form for the experiment sake and put it like this
<txp:soo_if_frontpage>
<txp:output_form form=“gallery” />
<txp:else />
<txp:output_form form=“nothing” />
</txp:soo_if_frontpage>
still no effect.
Offline
Re: Dynamic gallery only on homepage?
What is your production status? Have you looked through the tag trace?
Have you activated soo_if_frontpage?
Are you sure you are editing the correct page template?
Code is topiary
Offline
Re: Dynamic gallery only on homepage?
Alas. I activated the plug-in, tried all production statuses, page form is default like in the default txp, default section “article” – in other words – 100% default txp as it is. In theory, the plug-in is what I need for the site.
Offline
Re: Dynamic gallery only on homepage?
Please link to or post a tag trace.
Code is topiary
Offline
Re: Dynamic gallery only on homepage?
well, tag trace shows this on the home and the second page – does it mean anything good or bad?
<txp:soo_if_frontpage>
[<txp:soo_if_frontpage>: true]
<txp:output_form form=“gallery” />
[SQL (0,000576019287109): select Form from txp_form where name=‘gallery’]
[Форма: gallery]
</txp:soo_if_frontpage>
Offline
Re: Dynamic gallery only on homepage?
That part of the tag trace tells you that:
- the
soo_if_frontpage
tag evaluated as true; - the ‘gallery’ form was indeed output to the page
So, from the information you have provided, the tags in question are doing what you want and expect.
You mentioned jQuery so the next question is whether or not you are correctly loading the needed scripts on that page.
Code is topiary
Offline
Re: Dynamic gallery only on homepage?
They are doing all right on the front page, but they are doing all right page 2, 3, 4 as well. Gallery is loading ok. I createtd a test form with a word test in the mode misc for output , and the effect is the same – i see the word “test” on home page, page 2, 3, 4…. hmmm
Offline