Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2010-10-03 12:16:55

Katalonian
Member
From: Baku, Azerbaijan
Registered: 2010-04-18
Posts: 219
Website

if not "this" sections

There is some plugin wich opposite to <txp:if_section/>?
im need something like to show content if user are in page of another section. i know about <txp:else/>, i dont need it, because i have much more <txp:if_section/> in one place, and else dont help me in this situation.
wait for responce. thanks!


<txp:txp_me />

Offline

#2 2010-10-03 12:54:56

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: if not "this" sections

Katalonian wrote:

i know about <txp:else/>, i dont need it, because i have much more <txp:if_section/> in one place, and else dont help me in this situation.

Yes you need <txp:else /> :) If you can explain what exactly “this situation” is, I’m quite confident we can find a way to do it without plugin.

Offline

#3 2010-10-04 15:16:33

Katalonian
Member
From: Baku, Azerbaijan
Registered: 2010-04-18
Posts: 219
Website

Re: if not "this" sections

:)
This is code. http://shortText.com/uox5ssjj39
It’s a accordion menu. I want to do that if some one in one section of this menu, this section be first in list.
But if user on main page or in some other page, menu will be sorted how after <else>.


<txp:txp_me />

Offline

#4 2010-10-04 15:48:50

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

Re: if not "this" sections

Switching the order of a menu sounds like very poor usability. I know that’s not what you’re asking, but … are you sure you want to do this?


Code is topiary

Offline

#5 2010-10-04 15:52:15

Katalonian
Member
From: Baku, Azerbaijan
Registered: 2010-04-18
Posts: 219
Website

Re: if not "this" sections

I know jsoo…
But client, he decided and he want it.


<txp:txp_me />

Offline

#6 2010-10-04 16:25:06

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: if not "this" sections

If I understand correctly, if you’re on the homepage you want:

  • home
  • section1
  • section2

But if you’re in another section (section2 as an example here), it should look like this:

  • section2
  • home
  • section1

What’s not working in the code you currently have?

Offline

#7 2010-10-04 16:30:03

Katalonian
Member
From: Baku, Azerbaijan
Registered: 2010-04-18
Posts: 219
Website

Re: if not "this" sections

right!.
I have much more sections in menu list + other section, which in not list, and i want to view in other section which not in menu, like on home page(standart for all,which not in menu list.)


<txp:txp_me />

Offline

#8 2010-10-04 16:41:01

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: if not "this" sections

Something like this perhaps (not tested and you’ll have to replace the section names.)

/* first section */
<txp:if_section name="section1,section2">
  <span class="basic_a"><txp:section title="1" /></span>
  <txp:article_custom category='<txp:section />' form="list" sort="position asc" />
</txp:if_section>

/* remaining sections */
<txp:section_list sections="section1,section2" include_default="1" break="">
  <txp:if_section name='<txp:section />'>
    /* don't show here, section already shown at the top of the list */
  <txp:else />
    <span class="basic_a"><txp:section title="1" /></span>
    <txp:article_custom category='<txp:section />' form="list" sort="position asc" />
  </txp:if_section>
</txp:section_list>

Offline

Board footer

Powered by FluxBB