From: SourceForge.net <no...@so...> - 2007-04-27 13:22:50
|
Patches item #1703246, was opened at 2007-04-18 22:56 Message generated for change (Comment added) made by mithyt2 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=430842&aid=1703246&group_id=41586 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: rowd (rowd) Assigned to: rowd (rowd) Summary: Smarty function xoMeta: non-cached header values Initial Comment: The objective of this patch is to allow dynamic insertion of content into the document head of cached pages. A new method is added to the "xos_opal_Theme" class, which is registered in Smarty as non cacheable. This method can be used in Smarty templates and understands the following syntax: <{xoMeta type="stylesheet" src="modules/page/style.css"}> where the value of 'type' is either 'link', 'stylesheet', 'script' or 'meta'. Extra parameters are required depending on the type chosen. The stylesheet type used in the example requires either the 'src' parameter for a source file, or 'content' parameter for css code passed as a string. See the relevant class methods in class/theme.php for more details. The patch was built against 2.3.0-dev (trunk revision 807) ---------------------------------------------------------------------- Comment By: Jan Pedersen (mithyt2) Date: 2007-04-27 15:22 Message: Logged In: YES user_id=841117 Originator: NO A bit quick there - what I MEANT to say is that it works like a charm and will definitely be a valued addition for me. However, two things to look at: 1) $parms -> $params (for clarity) 2) check indexes for existance ($params['content'], $params['attributes'], etc.) so we avoid Notice: Undefined index: content in file /class/theme.php line xxx ---------------------------------------------------------------------- Comment By: Jan Pedersen (mithyt2) Date: 2007-04-27 15:08 Message: Logged In: YES user_id=841117 Originator: NO Awesome, this works like a charm and is VASTLY needed. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=430842&aid=1703246&group_id=41586 |