Show labels depending on whether there are relevant articles
Hi,
I actually have three questions for this one. I currently have the following XSLT code but it is not working correct, maybe I have done something really stupid but it seems to be displaying the opposite of what I want, for the first section I want it to display all news items that have an article type of "Editorials" but it is displaying all articles except ones that have an article type of "Editorials", the same is happening for the "Columists" part. Hopefully someone can spot what mistake I have made straight away and can answer my other question.
I want it to only display the "h1" text if it does find news items with that articletype (i.e. if there are no news articles with the article type of "Editorials" then I don't want the "h1" Editorials tag displayed). How would I go about changing the code to do that?
The last question is whether this is the most efficient way to do this bearing in mind I have 12 different "Article Types" so I will have to repeat the code 12 times. Thank you for any help, the code I have so far is as follows:
Show labels depending on whether there are relevant articles
Hi,
I actually have three questions for this one. I currently have the following XSLT code but it is not working correct, maybe I have done something really stupid but it seems to be displaying the opposite of what I want, for the first section I want it to display all news items that have an article type of "Editorials" but it is displaying all articles except ones that have an article type of "Editorials", the same is happening for the "Columists" part. Hopefully someone can spot what mistake I have made straight away and can answer my other question.
I want it to only display the "h1" text if it does find news items with that articletype (i.e. if there are no news articles with the article type of "Editorials" then I don't want the "h1" Editorials tag displayed). How would I go about changing the code to do that?
The last question is whether this is the most efficient way to do this bearing in mind I have 12 different "Article Types" so I will have to repeat the code 12 times. Thank you for any help, the code I have so far is as follows:
Editorials
Columnists
Hi,
Change
[code]
Editorials
[/code]
Regards,
/Dirk
Excellent, thank you for the response that has resolved my issue, I take it the "!" makes a command do the opposite then.
Hi,
Yep, != means 'is not equal to' in xslt slang.
Regards,
/Dirk
is working on a reply...