Unnecessary methods on Page

0 views
Skip to first unread message

Daniel Sheppard

unread,
Oct 26, 2007, 2:39:44 AM10/26/07
to radiant...@googlegroups.com

Just did a bit of a slash and burn on Page as there seemed to be a little cruft:

http://dev.radiantcms.org/radiant/changeset/568

All tests still pass, so nothing I removed seemed that valuable, but thought I'd double-check that I wasn't screwing up any untested code. Can you have a look-see over my changes?

The only actual change there should be is that render_text no longer exists, but that's because it was only ever used from the test helper (which now directly calls the private parse method)


John W. Long

unread,
Oct 26, 2007, 8:57:03 AM10/26/07
to radiant...@googlegroups.com
Daniel Sheppard wrote:
> Just did a bit of a slash and burn on Page as there seemed to be a little cruft:
>
> http://dev.radiantcms.org/radiant/changeset/568

I believe this line is important:

tag.locals.page = tag.globals.actual_page || tag.globals.page

Sean would know. Perhaps it's untested.

--
John Long
http://wiseheartdesign.com

Daniel Sheppard

unread,
Oct 26, 2007, 2:37:32 AM10/26/07
to radiant...@googlegroups.com
Just did a bit of a slash and burn on Page as there seemed to be a
little cruft:

http://dev.radiantcms.org/radiant/changeset/568

All tests still pass, so nothing I removed seemed that valuable, but

Sean Cribbs

unread,
Oct 26, 2007, 9:44:18 AM10/26/07
to radiant...@googlegroups.com
Right.  The point of that, and the lines in the 'snippet' tag is to retain a pointer to the page that is currently rendering, while allowing snippets to render in the context of the local page, perhaps inside an iteration or 'find' tag.  I guess the tests for that weren't there.  I'll look into them as soon as I can.

Sean

Daniel Sheppard

unread,
Oct 28, 2007, 7:00:31 PM10/28/07
to radiant...@googlegroups.com
But isn't tag.globals.page already a reference to the currently rendering page?  As far as I could see, the code was storing tag.globals.page as tag.globals.actual_page and then rendering a snippet through the render method of the current page... and then use the actual_page variable to
pretend that it was rendering in the context of another page instead. I changed it so that the rendering was just done by the render method of the
original page anyway - since you're not switching contexts, all the locals are there and the globals are also still correct.
 
 

From: radiant...@googlegroups.com [mailto:radiant...@googlegroups.com] On Behalf Of Sean Cribbs
Sent: Friday, 26 October 2007 11:44 PM
To: radiant...@googlegroups.com
Subject: [Radiant-Dev] Re: Unnecessary methods on Page

Sean Cribbs

unread,
Oct 29, 2007, 9:28:26 AM10/29/07
to radiant...@googlegroups.com
Hmm, ok.  I guess we just need some new tests to verify that the desired behavior is still there.  There is a subtle difference between the approaches, I'm just not sure what the difference will be in the end.

Sean
Reply all
Reply to author
Forward
0 new messages