You are not logged in.
Hmmm…. I was kindly advised by maniqui to use this plugin. I want to provide an option for user to “switch” which kind of article list is showed: few articles per page with article thumbs, or greater amount with just text-link.
So now I have in page:
<txp:smd_if field=“urlvar:textonly”
operator=“eq”
value=“yes”
>
<txp:article form=“text-list” limit=“100”>
<txp:else />
<txp:article form=“with-images” limit=“5”>
</txp:smd_if>
If I test this with linking to mysite.com/section/?textonly=yes
the list portion is empty. Actually it is now empty with plain “/section/” too, so what I’m doing wrong here?
Offline
Atleast close your <txp:article> tags, ie. <txp:article form="text-list" limit="100"> to <txp:article form="text-list" limit="100" />
Rah-plugins | What? I’m a little confused… again :-) <txp:is_god />
Offline
Thanks Gocom, but missing endings were only here because I wrote them wrong – the site is on local install on other computer. So copypaste didn’t work well :)
I found the reason was: I copied the example code block straight from the plugins help page, and there where those linebreaks and few additional spaces also. When I removed them, it started to work…
Offline
Hi Bloke
I’ve been trying to use your plugin to check to display content via article id but with no joy.
Using a single page template I need to display one particular chunk of content along with a single article in the section but not the rest. would the following work:
<txp:smd_if field=“id” operator=“eq” value=“7”>
<div class=“tabber”> <div class=“tabbertab”> <h2>Multi Vendor Approach</h2> <txp:article_custom category=“tab1-section-identity-connects” excerpted=“0” form=“identity-connects-tabs-content” limit=“1” pgonly=“0” section=“identity-connects” sort=“Section desc” /> </div>
<div class=“tabbertab”> <h2>Ensuring Success</h2> <txp:article_custom category=“tab2-section-identity-connects” excerpted=“0” form=“identity-connects-tabs-content” limit=“1” pgonly=“0” section=“identity-connects” sort=“Section desc” /> </div>
<div class=“tabbertab”> <h2>Leading Technology</h2> <txp:article_custom category=“tab3-section-identity-connects” excerpted=“0” form=“identity-connects-tabs-content” limit=“1” pgonly=“0” section=“identity-connects” sort=“Section desc” />
</div>
</div>
<txp:else />
</txp:smd_if>
I’ve also tried to get this to work use the category2 option but with no luck.
Think I’m being a bit thick with this!
cheers
Mark
Offline
Stef, top plugin thanks. I used it to present a different stylesheet to IE6 when in messy URL mode. I know, don’t ask!
Just for record here’s how:
<!--[if IE 6]>
<txp:smd_if field="permlink_mode" operator="eq" value="messy">
<link rel="stylesheet" type="text/css" href="./style/ie6win_messy.css" />
</txp:smd_if>
<![endif]-->
Offline
visualpeople
Sorry for the delay in replying. Confirmed as a bug. You get that error if you test a field for contents and the value to which you’re comparing is empty. In this case, you’ll get one of those nasty warning messages for every custom field you’ve left blank. I thought I’d addressed that in an earlier version of the plugin but perhaps I missed it; or maybe I’ve accidentally trashed that feature in a recent revision. Thanks for letting me know; I’ll have a look at the code and try to fix it as soon as I can.
markgr
Ah, yes, a small oversight in my docs. In article lists, the ‘id’ field isn’t filled by TextPattern. Try thisid instead:
<txp:smd_if field="thisid" operator="eq" value="7">
// Your div block here
</txp:smd_if>
I’ll update the docs and add that field in as an alternative to id. Incidentally, if you’re ever stuck for the name of a field, use debug="2" and you’ll see a whole hunk of stuff listed. Look for two headers labelled “PRETEXT” and “THIS ARTICLE”: those contain every field that the plugin can currently ‘see’, thus you can use any of the names (to the left of the => marks) in the field attribute.
gomedia
Thanks for sharing, nice tip.
The smd plugin menagerie — for when you need one more gribble of power from Textpattern.
Txp Builders – finely-crafted code, design and Txp
Offline
Hey Chumpus>
Here’s a tantalizing problem looking for a solution which likely involves three of your plugins. Just don’t quite know how.
Let’s say that I’d like a way to use a mailing list as a low-rent user authentication database, and take my maintenance of user accounts down to zero admin.
So I’d need the following.
I was thinking of the ultimate tag-team
Am I out of my freakin mind?
Offline
Is it possible to have two smd_if tags in the same article, for example:
notextile. <txp:smd_if field="urlvar:a" operator="isused">
<txp:php>
include('http://domain.com/index.php?a=1');
</txp:php>
<txp:else />
<txp:smd_if field="urlvar:page" operator="isused">
<txp:php>
include('http://domain.com/index.php?page=' .$_GET['page']. '&x=');
</txp:php>
<txp:else />
<txp:php>
include('http://domain.com/index.php');
</txp:php>
</txp:smd_if>
</txp:smd_if>
The first smd_if part is wrong because that is what I’m trying to add in but the second smd_if part works. So how would I get the first part to work??
<txp:Ruhh />
Offline
That should work in 4.0.7 with the new tag parser. BTW, you should filter $_GET with htmlspecialchars(gps('page')).
Offline
Ahh, well I have 4.0.6.
I almost got the added part to work but I get this error:
Parse error: syntax error, unexpected $end in /home/username/public_html/textpattern/publish/taghandlers.php(2811) : eval()'d code on line 3
What could go wrong? Here is what i have:
notextile. <txp:smd_if field="urlvar:page" operator="isused">
<txp:php>
include('http://domain.com/index.php?page=' .$_GET['page']. '&x=');
</txp:php>
<txp:else />
<txp:php>
include('http://domain.com/index.php');
</txp:php>
</txp:smd_if>
<txp:smd_if field="urlvar:a" operator="isused">
<txp:php>
include('http://domain.com/index.php?a=' .$_GET['a']. ');
</txp:php>
</txp:smd_if>
Last edited by Ruhh (2008-08-15 15:33:01)
<txp:Ruhh />
Offline