This Forum has been archivedVisit the new Forums
I love to use the PAGENAME function on wikia, but I was wondering if there was a way to shave characters off the right or left of the pagename and use an altered version of it within a wikilink? As in, "PAGENAME minus 4 characters from the left", or "the 4th character of PAGENAME". Is this an impossible dream? Many thanks!--Acer4666 10:09, May 31, 2011 (UTC)
- Depending on what it is that you want to achieve, you also might find the titleparts parser function anything from useful to useless. If you describe the issue in more detail, preferably giving links to a particular page which title you want to cut, then you can expect a more precise answer. — Sovq 10:23, May 31, 2011 (UTC)
- Ah! Many thanks. I tried to look at the titlepage parser thing but couldn't make head nor tail of the instructions!
- To describe my task in more detail: On the 24 wiki, all the titles of the episode pages go (eg): "Day 3: 11:00am-12:00pm". I was wondering if I could:
- a) Isolate the digit after "Day". This would be the 5th character of the page title and nothing else, but the lengths of the pages are not consistent - so it would have to disregard the first 4 characters, as well as anything after the 5th, which wouldn't be a constant number of characters.
- b) Isolate everything after the "Day 3: " - basically, get rid of the first 7 characters and keep the rest (again, it would not be a constant number of characters as some are "11:00am-12:00pm" and some are "1:00pm-2:00pm").
- Thanks!--Acer4666 10:48, May 31, 2011 (UTC)
(Reset indent) Okay what you said confused me. Can you please give us a link where this is done? If there isn't any could be more specific about it? Like what you meant by isolate, or what you meant by "but the lengths of the pages are not consistent - so it would have to disregard the first 4 characters, as well as anything after the 5th, which wouldn't be a constant number of characters." etc?
- Getting the digit (split PAGENAME by ":", get first part, remove first 4 characters):
- Getting the time (find first ":", skip the space, return rest of string):
- Thank you so much Porter21! I really appreciate the help, that's fantastic. I will try it out now - very kind of you to help me out!
- To Finchelfanno1 - I guess I wasn't being very clear, sorry! What I meant by "disregard the rest" was just I only wanted one character on its own. Looks like its solved now though - thanks for your interest though!--Acer4666 11:22, May 31, 2011 (UTC)