Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Is there a way to retrieve a portion of a page's URL string?
I have academic program pages (for a College and Seminary) that need to offer a link to course offerings based on which arm of the school is offering the course: the college, seminary, or distance ed office. Some courses overlap (are offered by more than one 'arm'), so I am hoping I can retrieve "college", "seminary", or "cde" from the URL, in order to tell certain links where to go.
Here are some link examples so you can see what I'm working with:
At the bottom of the program page, there is a link to "View all courses". I'd like to send users to CDE's course listings when they view the program at briercrest.ca/cde, and to seminary course listings when viewing the program page at briercrest.ca/seminary. (This is necessary because CDE and the Seminary don't offer all the same courses.)
That's the problem. To solve it, I'm hoping to be able to extract "cde" or "seminary" from the page URL so that I can tell the "View all courses" link which set of courses to link to.
I know that the whole URL path is accessible using
but is there a way to grab only a specific part of the URL?
I'm not trying to retrieve a parameter passed in the URL. That's easy enough. I'm trying to access a portion of the URL much earlier in the string.
Sorry for the repeat post. I'm getting parsing errors as I try to submit this post to the forum.
Never mind. I found the solution using:
<xsl:value-of select="$currentPage/ancestor-or-self::*[@level = 2]/@nodeName" />
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted