I have a directory of people with profiles. Inside the profile users are able to select (checkboxes) which departments they belong to. Some have 1, some have many. Currently I filter which results I want to display on a specific page by writing a WHOLE BUNCH of lines like this:
This is NOT a great way of doing it because I have to list every possible combination of departments in order for it to work correctly.
what I need is a statement that says:
If on nodeID="8576" and property="facultyDepartment" CONTAINS THE VALUE="Public Administration" AT ALL.
A statement like that would save me from having to figure out all of the possible combinations and allow me to say if this value is INCLUDED in the profile then display it on this page.
Any help anyone could provide would be MUCH appreciated!! Thank you in advance.
I think that you should start a new topic and describe your problem, as you did in your post above and give the topic a good headline
By creating a new topic I think that you will get the chance to get more useful answers. Another good thing is to share the code you have so far if is possible and not business critical. By doing this people have better opptunities to see your code and then help you to find the right solution.
<xsl:if test="filter[@id = '8576' and property = 'facultyDepartment' and contains(value, 'Public Administration')]">
<!-- display what you want here -->
</xsl:if>
If this isn't what you are after, then I'd need to see a snippet of your current XSLT for it to make more sense.
The probelm I would have with that kind of solution is that it would require me to write out the page template stuff for each "test". Let's say I have 20 departments, I would have to write the same exact thing to replace your "<!-- display what you want here -->" 20 times... and should I want to make a change to the page layout I would then have to update that 20 times as well... if that turns out to be the end solution ok, but it's not as optimal as I would like.
Here is a snippet of my code:
<!-- Build an XML variable with all the filters available --> <xsl:variable name="filterProxy"> <filter id="6624" property="facultyResearchInterests" value="health" /> <filter id="6623" property="facultyDepartment" value="Social Work" />
<!-- Grab the filter that applies to this page --> <xsl:variable name="facultyFilter" select="msxml:node-set($filterProxy)/filter[@id = $currentPage/@id]" />
<!-- Grab the root node to do lookups under --> <xsl:variable name="rootNode" select="umbraco.library:GetXmlNodeById(6394)" />
XSLT filter results if property includes a value
I have a directory of people with profiles. Inside the profile users are able to select (checkboxes) which departments they belong to. Some have 1, some have many. Currently I filter which results I want to display on a specific page by writing a WHOLE BUNCH of lines like this:
This is NOT a great way of doing it because I have to list every possible combination of departments in order for it to work correctly.
what I need is a statement that says:
If on nodeID="8576" and property="facultyDepartment" CONTAINS THE VALUE="Public Administration" AT ALL.
A statement like that would save me from having to figure out all of the possible combinations and allow me to say if this value is INCLUDED in the profile then display it on this page.
Any help anyone could provide would be MUCH appreciated!!
Thank you in advance.
Hi,
when I am adding article photo to my content page ..In my browser I am not able to see image ..
my window appears with the text as /media/1015/lighthouse.jpg
can you please help me . thanks.
Regards Tanya
Hi Tanya,
I think that you should start a new topic and describe your problem, as you did in your post above and give the topic a good headline
By creating a new topic I think that you will get the chance to get more useful answers. Another good thing is to share the code you have so far if is possible and not business critical. By doing this people have better opptunities to see your code and then help you to find the right solution.
/Dennis
@FarmFreshCode - did you figure this out already?
If not, you could try this...
If this isn't what you are after, then I'd need to see a snippet of your current XSLT for it to make more sense.
Cheers,
- Lee
Hi Lee! Thanks for responding.
The probelm I would have with that kind of solution is that it would require me to write out the page template stuff for each "test". Let's say I have 20 departments, I would have to write the same exact thing to replace your "<!-- display what you want here -->" 20 times... and should I want to make a change to the page layout I would then have to update that 20 times as well... if that turns out to be the end solution ok, but it's not as optimal as I would like.
Here is a snippet of my code:
You can see how writing out all of the combinations of filter properties is a pain.
Still would love some help on this topic.
is working on a reply...