Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1 2012-01-24 10:59:21
- makss
- Plugin Author
- From: Ukraine
- Registered: 2008-10-21
- Posts: 355
Bit usability with css tag
<txp:css /> tag return values such as link or url, but to get the name of the css style – it is impossible.
I suggest to extend the attribute format with value name. This is useful for external css styles.
What do you think?
.
patch :)
function css($atts)
{
global $css;
extract(lAtts(array(
'format' => 'url',
'media' => 'screen',
'n' => $css, // deprecated in 4.3.0
'name' => $css,
'rel' => 'stylesheet',
'title' => '',
), $atts));
if (isset($atts['n'])) {
$name = $n;
trigger_error(gTxt('deprecated_attribute', array('{name}' => 'n')), E_USER_NOTICE);
}
if (empty($name)) $name = 'default';
$url = hu.'css.php?n='.$name;
// added 3 lines
if ($format == 'name') {
return $name;
}
// patch end
if ($format == 'link') {
return '<link rel="'.$rel.'" type="text/css"'.
($media ? ' media="'.$media.'"' : '').
($title ? ' title="'.$title.'"' : '').
' href="'.$url.'" />';
}
return $url;
}
aks_cron : Cron inside Textpattern | aks_article : extended article_custom tag
aks_cache : cache for TxP | aks_dragdrop : Drag&Drop categories (article, link, image, file)
Offline
Offline