Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2014-12-24 09:55:28

raminrahimi
Member
From: India
Registered: 2013-03-19
Posts: 278

if not home page, then show something

hi to all,
i have some area on the page template which don’t want to show that on the home page, how i can make that plz?

ETC posted me a code which shows something if i’m on the home page that is:


<txp:variable name="pfr" value='<txp:page_url type="pfr" />' />
<txp:if_variable name="pfr" value='<txp:page_url />'>
...something...
</txp:if_variable>

but i need reverse of that, it mean if i’m on the home page, don’t want to show that.
thanks

Offline

#2 2014-12-24 10:17:14

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,171
Website GitHub Mastodon Twitter

Re: if not home page, then show something

HI raminrahimi

You can use something like

<txp:if_section name=""><txp:else />...something...</txp:if_section>

Alternatively you could use soo_if_frontpage.


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#3 2014-12-24 10:36:06

raminrahimi
Member
From: India
Registered: 2013-03-19
Posts: 278

Re: if not home page, then show something

colak:
but i’ve at all just one section, i don’t think that works fine.

i found the solution way :-) i did like this:


<txp:variable name="pfr" value='<txp:page_url type="pfr" />' />
<txp:if_variable name="pfr" value='<txp:page_url />'>
<txp:else />
.... something ....
</txp:if_variable>

Offline

#4 2014-12-24 10:40:44

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,171
Website GitHub Mastodon Twitter

Re: if not home page, then show something

Hi raminrahimi

I am not sure as to what type="pfr" stand for. It is not on the documentation. Also I’m not sure as to whether the code will work if index.php is added in the url.


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#5 2014-12-24 10:48:27

raminrahimi
Member
From: India
Registered: 2013-03-19
Posts: 278

Re: if not home page, then show something

hmmm yes, i face with that problem :-(
if someone write: index.php , again those area will show !

Offline

#6 2014-12-24 11:39:03

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,171
Website GitHub Mastodon Twitter

Re: if not home page, then show something

I guess that the plugin will offer you the solution


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

Board footer

Powered by FluxBB