Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2007-01-18 01:14:04

mrdale
Member
From: Walla Walla
Registered: 2004-11-19
Posts: 2,215
Website

conditional: article category or image category

Is there a way to construct a conditional that outputs differently based on whether the category assigned by the url is an “image” or an “article” category?

I’m trying to do something like..


If it's an article category
   then display this set of tags (article, plus some other stuff)
If it's an image category
   then display a gallery

Can’t seem to find any existing methods to achieve this, and I’m soooooo close to having a user-specific client section working on my site. I’m stuck at a place where I’m displaying redundant “you can’t see that peice of content” messages for image galleries and articles.

Thanks

Last edited by mrdale (2007-01-18 01:20:03)

Offline

#2 2007-01-18 08:28:27

marios
Archived Plugin Author
Registered: 2005-03-12
Posts: 1,253

Re: conditional: article category or image category

From a section front page?

In the latter case, it can be done using messy category URL’s and the hardcoding the URL’s for each image category and using the usual page constructs eg.: @<txp:if_individual_article> <p>my normal section permlink stuff</p> <txp:article limit=“1” form=“gen_lightroom_perm” /> <txp:else />

<txp:if_category> <p>we are t in category mode</p> <txp:article limit=“1” form=“gen_lightroom_2” /> </txp:if_category> </txp:if_individual_article>@

Then as a workaround, you could create one category ( named category, that isn’t get used)
This category URL:

http://mysite1.dev/lightroom/?c=category

for this page will be for the category landing page:

Here you can put your category list form:

And in the category article form, use the if_article_category tags one for name= category and one for each image category.

( just general outline )

I have it working nicely locally for a gallery Site.
Tell me if you need the forms that I am using.

regards, marios

Last edited by marios (2007-01-18 08:29:43)


⌃ ⇧ < ⌃ ⇧ >

Offline

#3 2007-01-18 17:53:12

mrdale
Member
From: Walla Walla
Registered: 2004-11-19
Posts: 2,215
Website

Re: conditional: article category or image category

Thanks Marios.

Here’s how it works currently. Not sure whether your approach would work with this, but here goes:

Section Frontpage

  • Display client specific article, image and file lists
    Not Section Frontpage
  • Article Tag
    • Username matches article category (which is set to client name)?
      • Display Article
    • Username does not match article category
      • Display a “permission denied” message.
  • Gallery Form
    • Username matches category’s parent (which is set to client name)?
      • Display Gallery vis rss_thumbpop
    • Username matches category’s parent
      • Display a “permission denied” message.

Which works, but also presents redundant “permission denied” messages”. What I’d like is something like this.

Section Frontpage

  • Display client specific article, image and file lists
    Not Section Frontpage
  • If it’s an article category
    • Article Tag
      • Username matches article category (which is set to client name)?
        • Display Article
      • Username does not match article ctaegory
        • Display a “permission denied” message.
  • If it’s an image category
    • Gallery Form
      • Username matches category’s parent (which is set to client name)?
        • Display Gallery vis rss_thumbpop
      • Username does not match category’s parent
        • Display a “permission denied” message.

Any ideas?

Offline

Board footer

Powered by FluxBB