Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2010-12-29 18:55:58

admi
Member
From: BY
Registered: 2007-12-10
Posts: 145
Website

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

#2 2010-12-29 19:31:09

jsoo
Plugin Author
From: NC, USA
Registered: 2004-11-15
Posts: 1,793
Website

Re: Dynamic gallery only on homepage?

soo_if_frontpage is one solution.


Code is topiary

Offline

#3 2010-12-29 20:25:01

admi
Member
From: BY
Registered: 2007-12-10
Posts: 145
Website

Re: Dynamic gallery only on homepage?

Thanx a lot. I felt it was something about if-else-thing.

Offline

#4 2010-12-29 23:59:56

admi
Member
From: BY
Registered: 2007-12-10
Posts: 145
Website

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

#5 2010-12-30 00:43:44

jsoo
Plugin Author
From: NC, USA
Registered: 2004-11-15
Posts: 1,793
Website

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

#6 2010-12-30 11:43:48

admi
Member
From: BY
Registered: 2007-12-10
Posts: 145
Website

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

#7 2010-12-30 11:50:16

jsoo
Plugin Author
From: NC, USA
Registered: 2004-11-15
Posts: 1,793
Website

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

#8 2011-01-02 13:03:43

admi
Member
From: BY
Registered: 2007-12-10
Posts: 145
Website

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

#9 2011-01-02 13:12:05

jsoo
Plugin Author
From: NC, USA
Registered: 2004-11-15
Posts: 1,793
Website

Re: Dynamic gallery only on homepage?

Please link to or post a tag trace.


Code is topiary

Offline

#10 2011-01-04 23:30:26

admi
Member
From: BY
Registered: 2007-12-10
Posts: 145
Website

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

#11 2011-01-04 23:53:28

jsoo
Plugin Author
From: NC, USA
Registered: 2004-11-15
Posts: 1,793
Website

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

#12 2011-01-05 00:08:14

admi
Member
From: BY
Registered: 2007-12-10
Posts: 145
Website

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

Board footer

Powered by FluxBB