Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

  1. Index
  2. » Archives
  3. » if_article_id

#1 2005-07-10 00:52:33

thebombsite
Archived Plugin Author
From: Exmouth, England
Registered: 2004-08-24
Posts: 3,251
Website

if_article_id

I’ve looked through the plug-ins over at Textpattern Resources and can’t find one so does anyone know of a plug-in that does “if_article_id” or is there a TXP tag I can use?


Stuart

In a Time of Universal Deceit
Telling the Truth is Revolutionary.

Offline

#2 2005-07-10 00:59:23

rsilletti
Moderator
From: Spokane WA
Registered: 2004-04-28
Posts: 707

Re: if_article_id

What are you trying to accomplish? I think all articles have IDs, but if I understood what you needed I might be able to give it a shot.

Offline

#3 2005-07-10 01:15:40

thebombsite
Archived Plugin Author
From: Exmouth, England
Registered: 2004-08-24
Posts: 3,251
Website

Re: if_article_id

Well it’s best to show you cuz I’ve already done most of it. If you go here and watch the page menu, as you click an option the button changes colour and goes inactive. I’m able to do this because they are different sections so I can use an if_section conditional, however if you go here I’m stuck because all the pages are in the same section. The only differential is the article id.


Stuart

In a Time of Universal Deceit
Telling the Truth is Revolutionary.

Offline

#4 2005-07-10 02:11:22

rsilletti
Moderator
From: Spokane WA
Registered: 2004-04-28
Posts: 707

Re: if_article_id

Ah yes, I see your point. Tough question though, I don’t know of anything right off hand. I’ll thrash at it for while as time permits and let you know.

Offline

#5 2005-07-10 02:21:50

thebombsite
Archived Plugin Author
From: Exmouth, England
Registered: 2004-08-24
Posts: 3,251
Website

Re: if_article_id

Okey dokey thank you. :)


Stuart

In a Time of Universal Deceit
Telling the Truth is Revolutionary.

Offline

#6 2005-07-10 23:04:00

rsilletti
Moderator
From: Spokane WA
Registered: 2004-04-28
Posts: 707

Re: if_article_id

I can make this idea work, but it has to be included in the article form. How to make a tag in a page context aware of which article is currently being displayed on it I haven’t figured out yet. In any case, give me your take on this idea.
Function goes this way:

<code>function if_article_select($atts,$thing)
{ global $thisarticle; extract(lAtts(array( ‘select’ => ‘’, ),$atts)); $condition = ($select == $thisarticle[‘thisid’] )? true : false; return parse(Evalelse($thing, $condition));
}</code>

If you think you will use it I’ll put it in a plugin for you.

Tags in the article form go this way ( this is just my test code, you would need to match article id’s) to avoid
displaying nested content in article list mode.

<code>
<txp:if_individual_article>
<txp:if_article_select select=“4”>
Content or tag here
<txp:else />
Alternate content or tag here<br />
</txp:if_article_select>
<txp:if_article_select select=“5”>
Content or tag here for 5
</txp:if_article_select>
</txp:if_individual_article></code>

It feels a little off center for what you are looking for, but the next step for me would be mucking around in URLs.

Last edited by rsilletti (2005-07-10 23:05:23)

Offline

#7 2005-07-10 23:36:54

thebombsite
Archived Plugin Author
From: Exmouth, England
Registered: 2004-08-24
Posts: 3,251
Website

Re: if_article_id

Are you saying that my menu form would have to be an “article” type or that my menu would have to go into the article itself. I don’t foresee any problems with the former but I’m not too sure about the second method. I would have to try it out. It may cause CSS problems though they are probably easy enough to get around. As I say I would need to try it out really.

Also I note that you are using “Evalelse” which is great, but is it based on the latest incarnation cuz I’m bang up-to-date on revisions as I use SVN?


Stuart

In a Time of Universal Deceit
Telling the Truth is Revolutionary.

Offline

#8 2005-07-11 01:06:30

rsilletti
Moderator
From: Spokane WA
Registered: 2004-04-28
Posts: 707

Re: if_article_id

It needs to be inside “the” article form in order to be able “see” the ID – which is what I think is off center about it.
Just being an article form type won’t accomplish that I don’t think.

Was built with r463 of 1rc3

Changed the name to if_article_id and included it with some other functions in a group, some may conflict as duplications if you are already using them. They are the same functions so replacing them would work.
I’ve two top ten downloads functions down as well.

Link to the present testing package @ <a href=“http://textcastle.com/index.php?s=file_download&id=11”>Plugin Download</a>, and they seem to run well on my localhost install, but the recent ones are effectively untested.

Last edited by rsilletti (2005-07-11 01:07:16)

Offline

#9 2005-07-11 15:12:16

thebombsite
Archived Plugin Author
From: Exmouth, England
Registered: 2004-08-24
Posts: 3,251
Website

Re: if_article_id

Excellent. Sorted thank you. :)


Stuart

In a Time of Universal Deceit
Telling the Truth is Revolutionary.

Offline

#10 2005-07-11 21:24:14

rsilletti
Moderator
From: Spokane WA
Registered: 2004-04-28
Posts: 707

Re: if_article_id

You’re welcome.
Nice wallpaper gallery by the way, I downloaded a few.

Offline

#11 2005-07-11 22:06:32

thebombsite
Archived Plugin Author
From: Exmouth, England
Registered: 2004-08-24
Posts: 3,251
Website

Re: if_article_id

:) Glad to be of service.


Stuart

In a Time of Universal Deceit
Telling the Truth is Revolutionary.

Offline

#12 2006-02-14 07:48:17

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

Re: if_article_id

Can someone move this thread under the plugins category? The plugin listed here is still active and relevant for 4.03


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

Offline

  1. Index
  2. » Archives
  3. » if_article_id

Board footer

Powered by FluxBB