(->1.6) meaningful colors for page tags
(->1.6) meaningful colors for page tags
Hello everbody,
Christoph once proposed moving the setting of pages to memberpage into the page data. However this makes it difficult to see right away, if a page has been set as members page or not. one would have to open the page data dialogue first.
What do you think about the possibility that a possible page tag for memberpages would be colored, let's say red, when a page is a memberpage. In this case you could see right away whether a pages is set as memberpage or not.
A colored page tags could also be used to show whether a page is hidden. Instead of a grey page tag "Page" there could be a red page tag, meaning, some important value is set different for this page. (Now I find myself often opening the page settings dialog to check, whether I set the page as hidden or not.)
Haven't thought about how to code it, just wanted to know what others think about it.
svasti
Christoph once proposed moving the setting of pages to memberpage into the page data. However this makes it difficult to see right away, if a page has been set as members page or not. one would have to open the page data dialogue first.
What do you think about the possibility that a possible page tag for memberpages would be colored, let's say red, when a page is a memberpage. In this case you could see right away whether a pages is set as memberpage or not.
A colored page tags could also be used to show whether a page is hidden. Instead of a grey page tag "Page" there could be a red page tag, meaning, some important value is set different for this page. (Now I find myself often opening the page settings dialog to check, whether I set the page as hidden or not.)
Haven't thought about how to code it, just wanted to know what others think about it.
svasti
Re: (->1.6) meaningful colors for page tags
Hi svasti,
IMO that would be a very nice addition!
An optional third parameter $color might already suffice as information for page_data to change the color.
Christoph
IMO that would be a very nice addition!
Just a quick idea: the tabs are created from the plugin by calling e.g.:svasti wrote:Haven't thought about how to code it
Code: Select all
$pd_router -> add_tab($plugin_tx['page_params']['tab'], $pth['folder']['plugins'].'page_params/page_params_view.php');
Christoph
Christoph M. Becker – Plugins for CMSimple_XH
Re: (->1.6) meaningful colors for page tags
Without thinking about coding...
in cms.php (?)
if adm
if page is memberpage <h?> = <h? class="mebmerpage">
if page is hidden <h?> = <h? class="hiddenpage">
if page is not published <h?> = <h? class="not published">
...
etc.
This way the page would have stylable heading for admin mode.
in cms.php (?)
if adm
if page is memberpage <h?> = <h? class="mebmerpage">
if page is hidden <h?> = <h? class="hiddenpage">
if page is not published <h?> = <h? class="not published">
...
etc.
This way the page would have stylable heading for admin mode.
CMSimple.sk
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.
Re: (->1.6) meaningful colors for page tags
That would inject a dependency on plugins into the core. If a new plugin will be written, which wants to use the feature, the core had to be adapted. I'd rather avoid that.Tata wrote:in cms.php (?)
But indeed, a CSS class offers more flexibility as a fixed color (good idea!). So what about:
Code: Select all
$pd_router->add_tab($name, $view_file, $css_class);
Christoph M. Becker – Plugins for CMSimple_XH
Re: (->1.6) meaningful colors for page tags
Whatever... I have on my TODO list with bold letters "Learn more about PHP and CMSimple!!!" but never had found the time and personal power to learn the basics. Also because of studying ready-made scritps and testing which change brings which result. Now I only thought about (at least for me) logical principles. And I am happy to add this hint. The class seems to me to be very pracital and flexible. The colors are then adjustable to the template (.e.g. different colors must be used for "negative" pages etc. So each webmaster can set the colors after his needs.
CMSimple.sk
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.
Re: (->1.6) meaningful colors for page tags
We don't have to wait for XH 1.6 to have the feature
It can easily be done in the plugin. Basically a single line of js is enough:
One has to adapt that to the current language, as the ID of this tab is 'tab_Seite' in German. In Slovak it's 'tab_Stránka'. Unfortunately this is invalid HTML 4.01 resp. XHTML 1.0 (might be valid HTML5, though):
It can easily be done in the plugin. Basically a single line of js is enough:
Code: Select all
document.getElementById('tab_Page').firstChild.style.color = 'red';
So IMO we should mangle the tab title for it's use as ID. bin2hex() seems to come in handy here. I suggest the following changes to plugins/pluginloader/page_data/page_data_views.php line 47ff:http://www.w3.org/TR/html401/types.html wrote:ID and NAME tokens must begin with a letter ([A-Za-z]) and may be followed by any number of letters, digits ([0-9]), hyphens ("-"), underscores ("_"), colons (":"), and periods (".").
Code: Select all
foreach($this -> tabs as $title => $code){
$id = bin2hex($title);
$view .= "\n\t".'<a class="inactive_tab" id="tab_'.$id.'" onclick="toggle_tab(\''.$id.'\');"><span>'.$title.'</span></a>';
}
$view .= "\n</div>\n".'<div id="pd_views">';
foreach($this -> tabs as $title => $file){
$id = bin2hex($title);
$view .= "\n".'<div id="PLTab_'.$id.'" class="inactive_view">'. "\n\t".'<a id="pd_editor_toggle" class="pd_open" onclick="toggle_tab(\''.$id.'\');"> </a>';
Christoph M. Becker – Plugins for CMSimple_XH
Re: (->1.6) meaningful colors for page tags
Hi Christoph:
Thanks to your hints Memberpages_XH 3.1 now changes the pagetab designation and color dynamically.
svasti
Thanks to your hints Memberpages_XH 3.1 now changes the pagetab designation and color dynamically.
svasti
Re: (->1.6) meaningful colors for page tags
Hi svasti,
So obviously it's not necessary to make any changes to the XH core regarding the stylability of the page data tabs.
Christoph
That's a nice and useful feature.svasti wrote:Memberpages_XH 3.1 now changes the pagetab designation and color dynamically
So obviously it's not necessary to make any changes to the XH core regarding the stylability of the page data tabs.
Christoph
Christoph M. Becker – Plugins for CMSimple_XH
Re: (->1.6) meaningful colors for page tags
with bin2hex() the id becomes pretty unreadable by developers, but who cares...
Re: (->1.6) meaningful colors for page tags
Alternatively we could use the basename() of the file containing the view's definition. This will hopefully consist of allowed characters only, and is at not subject to i18n, so it would be even easier for plugin developers to access it.
Christoph M. Becker – Plugins for CMSimple_XH