Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: swf_if_empty
Do you think this plugin could be made to work with comments? As in it will check if someone has inputted a website, then you display one thing, and if they haven’t, then you display another.
That would be really cool.
bludrop studios .::. Creative Expression
Offline
Re: swf_if_empty
RE: Comments
I’m not sure if this i can get this plugin to work with comments since I thought they were pretty closed, but now that i have some time, I can work on it to see. Give me a couple days and I’ll see what I can come up with.
If anyone has other suggestions, now would be the time to ask or offer.
Offline
#27 2005-06-12 07:13:32
- Andrew
- Plugin Author
- Registered: 2004-02-23
- Posts: 730
Re: swf_if_empty
What are the differences between this plugin and the built-in <txp:if_custom_field />
?
Offline
Re: swf_if_empty
This one doesn’t work with the custom fields but it does work with the other fields so you can setup a condition that if there is a category2, you can put a coma after category1.
BTW i didn’t realize there was an if_custom_field tag now. I wish there was at least a taglist for txp so I knew what was built-in now
Offline
#29 2005-10-27 17:22:50
- -rr-
- Member
- Registered: 2005-09-11
- Posts: 73
Re: swf_if_empty
I can’t seem to get this to work:
<code>
<txp:swf_if_not_empty category1=“Articles” minlength=“0” >
<h5>Articles</h5>
<ul><txp:chh_article_custom category=“Articles” listform=“titleonly” /></ul>
</txp:swf_if_not_empty>
</code>
<br>
will show the <code><h5>Articles</h5></code> title even though it doesn’t contain any articles, when what I’m trying to do is to hide the title if there are no articles.
If I put some articles in the category and up the “minlength” to anything above zero it lists nothing at all ???. Changing the category1 to category2 doesn’t seem to make a difference.
I’m stumped!
Offline
Re: swf_if_empty
it looks like you are trying to check the category to see if it has a value of “Articles”. The pugin can only check to see if a field is empty. You can use field=“category1” to check if category1 is empty, but not to see if it has a particular value
Last edited by swf (2005-10-28 02:35:57)
Offline
#31 2005-10-28 14:46:08
- -rr-
- Member
- Registered: 2005-09-11
- Posts: 73
Re: swf_if_empty
I just want to make a nice clean menu of articles within a section ordered by category with the names of the categories before the articles… No “empty” categories being visible of course.
How do I do this, anybody?
Offline
#32 2006-03-22 20:06:31
- Nell
- Member
- From: Mexico City, Mexico
- Registered: 2005-06-21
- Posts: 48
Re: swf_if_empty
Is it possible to use swf_if_not_empty and swf_if_empty in the same form or article?
I’m using both in an article form, but it is not working. It shows the body if it’s present, but it doesn’t show anything if it’s not.
My form is roughly like this:
<code>
<txp:swf_if_empty field=“body”>
<p>There’s no body</p>
</txp:swf_if_empty>
</code>
<code>
<txp:swf_if_not_empty field=“body” minlength=“3”>
<p>There is body!</p>
<txp:body />
</txp:swf_if_not_empty>
</code>
Thank you!
Offline
#33 2006-03-25 07:53:23
- Nell
- Member
- From: Mexico City, Mexico
- Registered: 2005-06-21
- Posts: 48
Re: swf_if_empty
Answering my own question, apparently this does not work. I removed the “if_not_empty” tag and it worked fine. I had to modify my markup a bit for it to work, though.
Offline
Re: swf_if_empty
Nell, ¿Cómo hiciste para utilizar “swf_if_empty” y “swf_if_not_empty” y que ambos funcionase?.
Saludos.
Offline
#35 2006-09-13 22:52:57
- Nell
- Member
- From: Mexico City, Mexico
- Registered: 2005-06-21
- Posts: 48
Re: swf_if_empty
Hola Rigel,
Déjame consultar el sitio porque tiene tiempo que lo hice y no recuerdo bien. Te contesto más tarde :)
Offline
#36 2006-09-13 23:45:31
- Nell
- Member
- From: Mexico City, Mexico
- Registered: 2005-06-21
- Posts: 48
Re: swf_if_empty
No encuentro el sitio donde tuve este problema, creo que al hacer un cambio eliminé esa forma. Recuerdo que no hubo forma de usar ambos tags en la misma forma y tuve que cambiar mi html para no necesitar uno de estos tags.
No sé si sea contra las reglas escribir en español en este foro. Te sugiero que en el foro de español pongas un post con el problema específico que tienes, con el html y todo, y te ayudo a resolverlo, o tal vez alguien más encuentre una solución.
Saludos!
Offline