Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#31 2004-07-14 17:57:12

mattmoss
Member
Registered: 2004-03-29
Posts: 23
Website

Re: <txp:mdm_if_category>

The plugin I wrote simply passes out the content between the start and end tags, so as written any txp tags inside do not get handled. What should be done is to take the content between the tags and pass it back into textpattern for further evaluation.

How that is done, I don’t know. I haven’t looked into it, and am busy on several other higher-priority things. If someone knows what function or bit of code I need to have the content further evaluated, please let me know and I’ll revise the plugin to use that.

Offline

#32 2004-07-14 19:07:15

Manfre
Plugin Author
From: North Carolina
Registered: 2004-05-22
Posts: 588
Website

Re: <txp:mdm_if_category>

You can tell txp to parse the enclosed text with a call to <code>parse($text);</code> in place of where you return the enclosed code.

Offline

#33 2004-07-15 16:10:38

nils73
Member
From: Germany (Duesseldorf)
Registered: 2004-07-07
Posts: 15
Website

Re: <txp:mdm_if_category>

In the meantime I used a workaround with inline PHP which works well for me. I wish I was a better PHP coder so that I could put the workaround into some abstract PHP code and make a plugin out of it.

The only thing I have manged on my own so far is a “plugin” to detect which browser the user is running and deliver custom content.

Offline

#34 2004-07-16 01:37:09

mattmoss
Member
Registered: 2004-03-29
Posts: 23
Website

Re: <txp:mdm_if_category>

Okay, the plugin has been updated. Version 0.4 of the mdm_if_category plugin is now available.

Offline

#35 2004-07-20 12:33:55

nils73
Member
From: Germany (Duesseldorf)
Registered: 2004-07-07
Posts: 15
Website

Re: <txp:mdm_if_category>

Great. Thank you very much. This makes things much easier.

Offline

#36 2004-11-16 14:06:55

apo
Member
From: Germany
Registered: 2004-10-27
Posts: 53

Re: <txp:mdm_if_category>

can anyone provide a link? splatbang seems to be down or something…

Offline

#37 2004-11-16 19:06:01

obeewan
Archived Plugin Author
From: Stockholm, Sweden
Registered: 2004-08-12
Posts: 319
Website

Re: <txp:mdm_if_category>

apo,

Works fine for me now, it was probably just a temporary down period.


Plugins: ob1_advanced_search 1.032b, ob1_search_score 1.0, ob1_pagination 2.5, ob1_title 4.1, ob1_modified 2.1

“Let your plans be dark and as impenetratable as night, and when you move, fall like a thunderbolt.”
— Sun Tzu

Offline

#38 2004-12-01 21:42:32

rayne
Member
From: AL USA
Registered: 2004-03-24
Posts: 58
Website

Re: <txp:mdm_if_category>

What about category heirarchy? I want to show/hide content but it could be any of a list of subcategories. Could some conditions be added for the parent/child relationship of categories?

Like say I have

  • Cat1
    • CatA
    • CatB
  • Cat2

I want to do the condition for if the category is any child of Cat1, but not nesessarily in Cat1 itself.

Thanks.
Rayne

Last edited by rayne (2004-12-01 21:44:03)


Rayne
mama love

Offline

#39 2004-12-01 22:16:37

rayne
Member
From: AL USA
Registered: 2004-03-24
Posts: 58
Website

Re: <txp:mdm_if_category>

Never mind. I reworked the categories so that I don’t have to do this.


Rayne
mama love

Offline

#40 2004-12-02 09:46:28

Martagnan
Member
From: Humberside - uk
Registered: 2004-06-21
Posts: 90
Website

Re: <txp:mdm_if_category>

Hello,
I have 2 categories ‘Incidentals’ and ‘Miscellaneous’ which are both in a section called ‘Meanderings’. I have page titles for all my sections that are called by CSS on the body tag.

On my ‘Meanderings’ page template I use txp:mdm_if_category like this…

<txp:mdm_if_category category="incidentals">
<body id="incidentals">
</txp:mdm_if_category>
<br />
<txp:mdm_if_category category="Miscellaneous">
<body id="meanderings">
</txp:mdm_if_category>

This works fine until I try to view an article and the title disappears. Can anyone suggest a workaround for this? – other than have a separate section for one of my categories.

Cheers

Last edited by Martagnan (2004-12-02 09:47:35)

Offline

#41 2004-12-06 16:46:35

ddsoul
New Member
From: Vancouver, BC
Registered: 2004-12-03
Posts: 5
Website

Re: <txp:mdm_if_category>

this is exactly what I’ve been looking for … thanks man!!!!!

Offline

#42 2004-12-16 16:38:00

Case
Member
From: UK
Registered: 2004-02-25
Posts: 20
Website

Re: <txp:mdm_if_category>

This plugin is great – thanks!

However I have a problem. I’m trying display some text only if the current category is not matched. This works fine, but the text also appears even if there is no category being viewed at all.

This is my code:

<txp:mdm_if_category category="!my category"> my text </txp:mdm_if_category>

I’d like it if this worked only if there was a category in use. Any suggestions?


Forget your dreams

Offline

#43 2004-12-18 21:34:16

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

Re: <txp:mdm_if_category>

If you don’t have too many categories, you could use something like this: category=“Category1,Category2,Category4”, thus excluding Category3.

Offline

#44 2004-12-18 23:07:32

Case
Member
From: UK
Registered: 2004-02-25
Posts: 20
Website

Re: <txp:mdm_if_category>

Thanks doggiez, but I need this to work without manually having to enter all my categories.

I’ve managed to hack the plug-in now so it works.


Forget your dreams

Offline

#45 2005-01-02 18:58:36

paularms
Member
From: University of Minnesota
Registered: 2004-10-21
Posts: 155
Website

Re: <txp:mdm_if_category>

Thanks a lot for this plugin. I’m with Case though, I wish it would just know what category is being displayed so I wouldn’t have like 12 copies of a whole bunch of code.

Offline

Board footer

Powered by FluxBB