How to retrieve a page's file in ASP using a nodeList

46 views
Skip to first unread message

Evil Midnite Bomber

unread,
Mar 2, 2012, 12:28:18 AM3/2/12
to RedDot CMS Users
Hi, all.

Let me first thank you all for the help I've received to date. I've
only been using RedDot for a couple years but I'm still running into
things that weren't covered in the training course and it's nice to
have this group as support.

So on to today's problem....I'm working on an asp that generates a
report that list elements and attributes of a page. I'm new to ASP
coding with RedDot and this asp that I'm using was written by a
contractor that is no longer with us. I'm modifying it to display more
information than was previously listed.

From what I understand, the headline of the page is extracted by using
the following:
>>headline = nodeList.item(i).getAttribute("headline")<<

I'd like to be able to extract the file name from the properties of
the page and create the published URL (http://www.blah.blah.com/
<filename>.html). I figure that I should be able to get that info
using the above method with a different attribute string. I just don't
know what that string would be.

Is this the correct way to get what I'm looking for or is there a
simpler, more obvious way that I'm missing? For my future reference,
is there a list of attribute strings that are available using this
method?

Thanks in advance,
EMB

Jian Huang

unread,
Mar 2, 2012, 9:59:00 AM3/2/12
to reddot-c...@googlegroups.com
Hi,

Assume that this is RQL, and the XML DOM has been loaded into the nodeList.  The attribute for filename is "name".

so...

nodeList.item(i).getAttribute("name")

Please keep in mind that this return nothing if the user has not assigned a file name to the page.

Then on publish, CMS would automatically assign page id or guid as filename, depending on your publication settings.

If you are writing a plugin to automatically assign headline as filename, then it is already written and available here
http://simplyreddot.blogspot.com/2012/02/auto-file-name.html

If you are writing a plugin to list all pages and the filenames, and perhaps ability to mass assign file names, it is also written and available here
http://simplyreddot.blogspot.com/2012/02/file-renamer.html

Best,

-Jian

Evil Midnite Bomber

unread,
Mar 7, 2012, 9:12:11 PM3/7/12
to reddot-c...@googlegroups.com
Hi, Jian.

Thanks for that. I'll give it a try.

Regards,
EMB
Reply all
Reply to author
Forward
0 new messages