Forum for discussing general topics related to Couch.
15 posts Page 2 of 2

When the parser analyzes a given script, it breaks it up into 'code' and 'text' where 'text' is basically everything that is not a Couch tag.

Info about both are pushed onto the context stack ($CTX->push) but since the text block is basically anonymous, the 'name' part for it remains blank (as opposed to 'code' where the name identifies the tag in question).
Thank you, it helps.

Next, there is one more thing that bothers my mind every time I analyze my log: class KFuncs->_handle_extends. I understand it as that every time a snippet is embedded or rendered, Couch checks for <cms:extends /> tag. With a starter default theme, without any complications, I counted over 30 calls of _handle_extends. Is there any way to avoid this?
Say `Please!` [̲̅$̲̅(̲̅ ͡° ͜ʖ ͡°̲̅)̲̅$̲̅]..... Active topics [Forum posts from previous 7 days].... [My email for friends]
Is there any way to avoid this?
Well, if you are sure you don't want to use the <cms:extends> feature, you may try unregistering the following event listener that functions.php places by default in KFuncs constructor -
Code: Select all
$this->add_event_listener( 'alter_parsed_dom', array('KFuncs', '_handle_extends') );
Thank you, Kamran. Of course, unregistering would disable that feature, shaving off some cycles, however I wondered if it was possible to write the code so that it would be triggered only by the tag <cms:extends />. Perhaps, it was simply not possible.

My next question is about KNestable class and its derivatives. I am trying to approach this class (found in couch/folders.php) and study it. There are many auxiliary functions and callbacks spread around Couch (some went to tags.php), visitor functions, menuitem concept (most hard for me currently). It would help to have any comments about this class and maybe an insight about general patterns that were used.

P.S. Also, it is new to me that folders are not available for non-clonable templates. Folders are in database, but selector is not visible - so can not set a folder (perhaps, dynamically generated from a clonable template) to a single template. Superadmin is free to create any number of non-clonable templates, if she opts to do so, for example - item1.php, item2.php, item3.php setting a folder for each of one as if a tag. Maybe unpractical, yes, giving better options in Couch (nested pages and clonable templates), but possible. Anyway, tag cms:folder is not ignored and folders are placed into database. Why is it so?
Say `Please!` [̲̅$̲̅(̲̅ ͡° ͜ʖ ͡°̲̅)̲̅$̲̅]..... Active topics [Forum posts from previous 7 days].... [My email for friends]
@KK, your comments, please?
Say `Please!` [̲̅$̲̅(̲̅ ͡° ͜ʖ ͡°̲̅)̲̅$̲̅]..... Active topics [Forum posts from previous 7 days].... [My email for friends]
15 posts Page 2 of 2

Who is online

In total there are 6 users online :: 0 registered, 0 hidden and 6 guests
(based on users active over the past 5 minutes)

Users browsing this forum: No registered users and 6 guests