FANDOM


This Forum has been archived

Visit the new Forums
Forums: Index Community Central Forum Altering PAGENAME function
FANDOM's forums are a place for the community to help other members.
To contact staff directly or to report bugs, please use Special:Contact.

50px-Replacement filing cabinet.svg

Note: This topic has been unedited for 3324 days. It is considered archived - the discussion is over. Do not add to unless it really needs a response.

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)

You should be able to do it with #explode RandomTime 10:11, 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)
So a link to an example: here, and I would want to isolate the "3" as well as the "11:00am-12:00pm"--Acer4666 10:50, 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? Finchelfanno1  (talk)  10:59,5/31/2011 

Getting the digit (split PAGENAME by ":", get first part, remove first 4 characters):
{{#sub:{{#explode:{{PAGENAME}}|:|0}}|4}}
Getting the time (find first ":", skip the space, return rest of string):
{{#sub:{{PAGENAME}}|{{#expr:{{#pos:{{PAGENAME}}|:}}+2}}}}
-- Porter21 (talk) 11:17, May 31, 2011 (UTC)
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)
Community content is available under CC-BY-SA unless otherwise noted.