Support ⇒ Themes ⇒ Hunter Theme Critique ⇒ Community Forums ⇒ CPG Dragonfly™ CMS
Forum IndexThemes

Hunter Theme Critique Reply to topic

Go to page Previous 1, 2, 3

I like the idea, good to specify css for each block but is it that hard to use the already existing block id or I'm missing something?

.:: I met php the 03 December 2003 :: Unforgettable day! ::.

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
CloudLinux / Apache 2.4 LSAPI / MySQLi 5.6 / PHP 5.6 / DCVS


You can use the peXX except ...

When first setting up a new block then yes, the amount of work is about the same either way.

But to add another block which needs to have the same treatment as an existing one means looking up the pe-number, then editing your CSS file to add a ", pe19" to the existing CSS entry, then re-upload to server, etc.

Rather than just adding the same CSSname to the new block. Ie it turns a browser edit into a FTP operation.

Its cleaner, so much easier to see what's set to what after the fact, than by searching for pe numbers.

(Ideally you'd have a set of pre-canned CSS entires already supplied with a select - but that's a bigger change.)

But I don't need it in DF9. (I will include the cssname stuff in my reDesign3+ theme though, so the patch to Blocks, etc is all that's required to enable.)

Pro_News CM™ - Content Management for Dragonfly CMS™

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Linux / 1.3.39 - 2.4.9 / 5.5.42 - 5.6.16 / 5.4.37 - 5.5.11 / 9.4


Dizfunkshunal wrote
Still couldn't get it to work, I left it up on my site using Hunter theme as Preview. After reviewing all the posts in this thread. I think Bulldogs Solution is better for what im wanting to do. Of course that is if he doesn't mind releasing his work. Smile Will you bulldog?

Hope no hard feelings layingback, Thanks for your help.


Well I think for a solution I would use layingbacks idea seems a simpler
route

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
PHP Version 7.0.6 + MariaDB + Dragonfly 9.4 Modified


Well on second thought....
I think since your designing the theme then I would load a small custom
php script in the theme.php file and you can load anything you want without
any changes to df core... or blocks system

a simple 1 page user admin to allow for selection of content and loading
any special css or js wanted. Remember it's your script so it can
Load a block from df or video embed code or user custom.....

No changes to df required

If i were going to change df first I'd put in a theme installer in the core..
Then each theme if wanted to could have an admin section for the theme
in df admin section to make any setting for that theme.........

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
PHP Version 7.0.6 + MariaDB + Dragonfly 9.4 Modified


Please don't get me wrong. I like both ways. layingback's resolution will work great for my hunter theme. But Bulldog's is going for a much bigger project.

I see Bulldogs mod as a beginning to a theme admin section, only issues i see with it is it changes the DF core. That is only an issue since it is so hard/near imposable to get anything added to the core and with it changing core files updates would be a pain. So what my plan is and it may take me awhile with or with out help is to make Bulldogs mod work independently from the core. Its own database table, if i understood correctly you rewrote the blocks, I would say with a little rewriting again you version can become maybe a second blocks. like blocks2.php since only themes that are made to use it will require editing, set something up in the theme.php to use default block system as well as a secondary block system.

Right now all i got is ideas. Like i was also thinking of adding a built in file editor so admin can make small changes and such from within DF instead of having to open the files, edit it them, ftp them.


Maybe im thinking to big and should start out smaller, I dont know but im gonna try it any how.

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Multiple Setups


bulldog500 wrote
If i were going to change df first I'd put in a theme installer in the core..
Then each theme if wanted to could have an admin section for the theme
in df admin section to make any setting for that theme.........


Yeah, I was thinking of adding a module to reDesign3+ for user to set up options. Ironically this mod may make it possible to avoid that, but there are other merits in taking this installer route for themes.

Pro_News CM™ - Content Management for Dragonfly CMS™

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Linux / 1.3.39 - 2.4.9 / 5.5.42 - 5.6.16 / 5.4.37 - 5.5.11 / 9.4


@NanoCaiordo, I remember now why I went this route: I understood that Dizfunkshunal wanted to ship his theme with a block relocate already set up for his TV simulation. This is possible with a symbolic name base solution, he sets up the CSS definitions and tells his user which one(s) to use. But it's impossible to tell user to create his block as, say, id pe13, so he'd have to end up asking user to edit CSS.

Pro_News CM™ - Content Management for Dragonfly CMS™

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Linux / 1.3.39 - 2.4.9 / 5.5.42 - 5.6.16 / 5.4.37 - 5.5.11 / 9.4


Dizfunkshunal wrote
Maybe im thinking to big and should start out smaller, I dont know but im gonna try it any how.


You are on the right track here
I sure like the secondary block system idea..

Also would require a theme settings thing (mod if you want to call it that)
I discourage the editor idea as most just don't get it right
But we could include a style settings panel
They would be able to set in the settings panel....
body { color: {S_BODY_FONTCOLOR}; font-family: {S_BODY_FONT}; {S_BODY_FONT_SIZE} line-height: {S_BODY_LINEHEIGHT}; } h1 { color: {S_H1_FONTCOLOR}; font-family: {S_H1_FONT}; {S_H1_FONTSIZE} line-height: {S_H1_LINEHEIGHT}; font-style: {S_H1_FONTSTYLE}; font-weight: {S_H1_FONTWEIGHT}; {S_H1_FONTEFFECTS}; } form { font-family: {S_FORM_HTML_FONT_BASIC}; {S_FORM_HTML_FONT_SIZE} line-height: {S_FORM_HTML_LINEHEIGHT}; color: {S_FORM_HTML_FONTCOLOR}; } button, input, select, submit, textarea { font-family: {S_FORM_ELEMENTS_FONT_BASIC}; {S_FORM_ELEMENTS_FONT_SIZE} line-height: {S_FORM_ELEMENTS_LINEHEIGHT}; color: {S_FORM_ELEMENTS_FONTCOLOR}; } input[type=text] { height: {S_TEXTBOX_HEIGHT}px; width: {S_TEXTBOX_WIDTH}px; } input[type=submit] { height: {S_SUBMITBUTTON_HEIGHT}px; } label { color: {S_LABELS_FONTCOLOR}; font-family: {S_LABELS_FONT}; {S_LABELS_FONTSIZE} font-style: {S_LABELS_FONTSTYLE}; font-weight: {S_LABELS_FONTWEIGHT}; {S_LABELS_FONTEFFECTS}; margin: 5px 0 2px 0; }

At a later date when we are happy with the settings we give the user
I would write a script to parse and generate the css for the tpl on the fly

<link rel="stylesheet" href="path_blablabla.php" type="text/css" />


End results example
/* headings */
h1 {
color: #333333;
font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
font-size: 32px;
font-size: 2rem;
line-height: 1.5;
font-style: normal;
font-weight: normal;
text-shadow: none;
}

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
PHP Version 7.0.6 + MariaDB + Dragonfly 9.4 Modified


As a side note, a theme developer could simply check if custom.css exists and if it does send it to header as last. Theme off course wont be shipped with that file.

At least this is what v10 will do automatically.

This way users can override or create css rules without any risk to lose any css modifications.

.:: I met php the 03 December 2003 :: Unforgettable day! ::.

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
CloudLinux / Apache 2.4 LSAPI / MySQLi 5.6 / PHP 5.6 / DCVS


Indeed, this is what reDesign does, calling it specific.css - if someone needs to copy the code.

The one in reDesign is used so that user doesn't need to mess with style.css, making subsequent update installs much, much simpler.

(I've also added same idea to Pro_News for same reason.)

Pro_News CM™ - Content Management for Dragonfly CMS™

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Linux / 1.3.39 - 2.4.9 / 5.5.42 - 5.6.16 / 5.4.37 - 5.5.11 / 9.4


I was a bit slow realising this ... Laughing but if I put collapsed in my new CSSName field the block starts out collapsed! Excellent! At least for reDesign3 YMMV.

And I've managed to get side block columns to load collapsed in reDesgn3, only making a small mod in theme.php Smile So will be releasing alpha copies of reDesign3+ in the new year. (Just need to test it out on a live site first just in case.)

Pro_News CM™ - Content Management for Dragonfly CMS™

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Linux / 1.3.39 - 2.4.9 / 5.5.42 - 5.6.16 / 5.4.37 - 5.5.11 / 9.4


Here is the best solution:

add to your theme.php any where:
function create_block($mixed) { if (!is_int($mixed) && (is_string($mixed) && !preg_match('#^[a-z0-9\-_]+$#i', $mixed))) { trigger_error('Invalid parameter, $mixed only accepts: int, string [a-z0-9-_]', E_USER_WARNING); return; } global $db, $prefix; if (is_int($mixed) && $row = $db->sql_ufetchrow("SELECT * FROM {$prefix}_blocks WHERE bid=".$mixed)) { switch ($row['bkey']) { case 'custom': $content = $row['content']; break; case 'file': $content = ''; if (!is_file("blocks/{$row['blockfile']}")) { trigger_error("blocks/{$row['blockfile']} does not exists", E_USER_WARNING); return; } include("blocks/{$row['blockfile']}"); break; default: return; } } if (!isset($content)) { if (!is_file("blocks/block-{$mixed}.php")) { trigger_error("blocks/block-{$mixed}.php does not exists", E_USER_WARNING); return; } $content = ''; include("blocks/block-{$mixed}.php"); } if (isset($content)) { global $cpgtpl; require_once('includes/nbbcode.php'); $cpgtpl->assign_var("block_{$mixed}", decode_bb_all($content,1,1)); } } if (defined('HEADER_OPEN')) { # In templates call as {block_25} or {block_Forums_scroll_Last_posts} create_block(1); create_block('CPG_Main_Menu'); create_block(33); create_block('Forum_Stats'); }

create_block(1) to show a block anywhere in the template but bock has to be created in blocks admin, does not have to be active but has to be their to be called by (1) the block id. call block by id in templates by {block_1}

create_block('Name-Of_block_file') this option only needs the block file to be in the block folder, does not have to be created in block admin. call block in template by file name {block_name_ofBlock}
must have block_ in front of it.


as for displaying a different block in the tv per module add
'MODULE_NAME' => $module_name,
to the cpgtpl vars array and then use IF/ELSE/AND statements in the template.


Thanks Nano for the help and script.

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Multiple Setups

All times are UTC
Go to page Previous 1, 2, 3


Jump to: