Welcome to Geeklog, Anonymous Monday, December 23 2024 @ 07:09 am EST

Geeklog Forums

Stylesheets and an RSS feed


Status: offline

timesscar

Forum User
Newbie
Registered: 04/24/06
Posts: 2
working
I am setting up a server for my workplace, and my goal for using Geeklog was to use it as a "news" engine, and then push an rss (in an xml document) feed into an iframe on the main page on my website. It would work fine, but without a stylesheet specification, it will only load the code for the xml document unless i manually insert a stylesheet specification at the start of the geeklog.xml (the one generated by geeklog). This wouldn't be such a big deal, but the geeklog.xml is written over with every change, so its a nuisance to have to add it every time. Is there a workaround, or a way to fix this that I may have missed? Thank you very much for your time.
 Quote

Status: offline

timesscar

Forum User
Newbie
Registered: 04/24/06
Posts: 2
Wow, no one has any idea? This didn't seem like it would be all that difficult. Banging your head Can someone help me
 Quote

Status: offline

beewee

Forum User
Full Member
Registered: 08/05/03
Posts: 969
Location:The Netherlands, where else?
Don't you need an XML parser?
Dutch Geeklog sites about camping/hiking:
www.kampeerzaken.nl | www.campersite.nl | www.caravans.nl | www.caravans.net
 Quote

timesscar

Anonymous
freakingout
That statement confuses me... Both firefox and IE can parse xml by default. You just have to give it a stylesheet specification. I am just looking for a way to insert the stylesheet line at the start of the xml doc. Other details are mostly irrelevant.

Is there a line I could add to whatever script generates the feed?

Thanks again.
 Quote

timesscar

Anonymous
Here is an example of a stylesheet line;

 Quote

timesscar

Anonymous
<?xml-stylesheet href="http://commtech/wiki/lib/rss/rss-style.css" type="text/css"?>
 Quote

Status: offline

THEMike

Forum User
Moderator
Registered: 07/25/03
Posts: 141
Location:Sheffield, UK
There are two things I can think you could do.

Firstly, rather than using an iFrame, you could use some very simple code to read the rss feed from geeklog in, prepend/insert the CSS line into the XML and render that to the browser.

Or, you could amend geeklog to include that line. The place to do this would be in the /path/to/geeklog/system/classes/syndication/rss.feed.class.php (hmm not sure if it's feed or feedparser or something else, but that should be enough information for you to find the actual file).

The class has a _writeheader or similar method that outputs the header of the XML file, just amend that to include the XML CSS code.
 Quote

timesscar

Anonymous
Excellent, thank you mike.
 Quote

Status: offline

waltnjulie

Forum User
Newbie
Registered: 06/11/06
Posts: 7
I solved that problem by getting rid of the iframe so the page would use the style sheets I was already using. Turned out to be easier to use a simple table. See http://www.rhoadsart/blogframe.html to see the result.

Now, if I could just solve the date format problem....

--Julie
 Quote

All times are EST. The time is now 07:09 am.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content