Insert CSS file per template style

bernardoa
4 Posts
bernardoa posted this 15 February 2016

Hello,

I've been using Artisteer for a number of years and every template I've edited I always add a variable on the template to allow me to choose a different CSS file per template style. I'd like to be able to do the same in Themler. To modify an Artisteer file I would first add the variables as a fieldset on the template's XML file, templateDetails.xml. Then I'd modify the index.php file to get the variables and display, and voila! I could add a CSS file for every template style I create...

How do I do the same procedure on a Themler index.php file? It does not have the same properties where I can display Custom page style. Anyplace I add it busts the template. Any suggestions?

// this is what I add to XML file

<field name="pagestyle" type="list" default="default_style"
                label="Page Style"
                description="Changes the page style sheet."
                filter="word">
            <option value="default_style">Default Style</option>
            <option value="services_style">Services Style</option>
            <option value="style_about">About Page Style</option>
            <option value="style_services">Services Page Style</option>
            <option value="style_clients">Clients Page Style</option>
            <option value="style_contact">Contact Page Style</option>
            <option value="style_news">News Page Style</option>
        </field>

These are what I add to index.php file to get the name of the stylesheet and display.

// get page style params from template

$pagestyle  = $this->params->get('pagestyle');

But, I don't know where to add this part on Themler's index.php file:

<!--display Custom page style -->
<link rel="stylesheet" type="text/css" href="<?php echo $templateUrl; ?>/css/<?php echo $pagestyle ?>.css" media="screen" />

Any suggestions on where to add this last line to output the CSS file path?

Thank you in advance!

Bernard

Hello, I've been using Artisteer for a number of years and every template I've edited I always add a variable on the template to allow me to choose a different CSS file per template style. I'd like to be able to do the same in Themler. To modify an Artisteer file I would first add the variables as a fieldset on the template's XML file, templateDetails.xml. Then I'd modify the index.php file to get the variables and display, and voila! I could add a CSS file for every template style I create... How do I do the same procedure on a Themler index.php file? It does not have the same properties where I can display Custom page style. Anyplace I add it busts the template. Any suggestions? // this is what I add to XML file <field name="pagestyle" type="list" default="default_style" label="Page Style" description="Changes the page style sheet." filter="word"> <option value="default_style">Default Style</option> <option value="services_style">Services Style</option> <option value="style_about">About Page Style</option> <option value="style_services">Services Page Style</option> <option value="style_clients">Clients Page Style</option> <option value="style_contact">Contact Page Style</option> <option value="style_news">News Page Style</option> </field> These are what I add to index.php file to get the name of the stylesheet and display. // get page style params from template $pagestyle = $this->params->get('pagestyle'); But, I don't know where to add this part on Themler's index.php file: <!--display Custom page style --> <link rel="stylesheet" type="text/css" href="<?php echo $templateUrl; ?>/css/<?php echo $pagestyle ?>.css" media="screen" /> Any suggestions on where to add this last line to output the CSS file path? Thank you in advance! Bernard
Vote to pay developers attention to this features or issue.
10 Comments
Order By: Standard | Newest
Stagger Lee
1818 Posts
Stagger Lee posted this 15 February 2016

You are coming from Joomla world, dont you ?

What is a reason for something like that ? Can you give real live examples.

You are coming from Joomla world, dont you ? What is a reason for something like that ? Can you give real live examples.
bernardoa
4 Posts
bernardoa posted this 16 February 2016

Hi Stagger Lee,

Yes, I'm a Joomla website designer/developer. I display a CSS file for each section of a website because it provides maximum flexibility styling on a per-section basis. Then I can control what CSS file each section uses through the Joomla administrator. Once set up this way, it is quick to set up and get to work. An example is to show a one color-theme for Services pages and different color-theme for Clients page, each with different appearance but using the same CSS classes and IDs. Does that make sense?

If there is a different method to define different sets of CSS styles for different sections of the same website, I'd like to know. Until then, I need to be able to choose a different style sheet per different template-style. That is the simplest and cleanest way to organize styling code, and it's easy to maintain as my client websites evolve.

Does that help? Can you help me?

Thanks,

Bernard

Hi Stagger Lee, Yes, I'm a Joomla website designer/developer. I display a CSS file for each section of a website because it provides maximum flexibility styling on a per-section basis. Then I can control what CSS file each section uses through the Joomla administrator. Once set up this way, it is quick to set up and get to work. An example is to show a one color-theme for Services pages and different color-theme for Clients page, each with different appearance but using the same CSS classes and IDs. Does that make sense? If there is a different method to define different sets of CSS styles for different sections of the same website, I'd like to know. Until then, I need to be able to choose a different style sheet per different template-style. That is the simplest and cleanest way to organize styling code, and it's easy to maintain as my client websites evolve. Does that help? Can you help me? Thanks, Bernard
Stagger Lee
1818 Posts
Stagger Lee posted this 16 February 2016

That is why you use visual tool Themler. To have overview of situation and dont care about CSS code.

You can style each separate page/template differently. You can style specific blocks on page different, without thinking about CSS files.

Dont know now how template in Themler has to be named (filename) for Joomla to pick it up as category (section) template.

That is why you use visual tool Themler. To have overview of situation and dont care about CSS code. You can style each separate page/template differently. You can style specific blocks on page different, without thinking about CSS files. Dont know now how template in Themler has to be named (filename) for Joomla to pick it up as category (section) template.
bernardoa
4 Posts
bernardoa posted this 16 February 2016

Hi Stagger Lee,

I'll be honest. I like Themler's concept and I think it's going in the right direction. But it's taken me the better part of 6 months trying it out and I still have a hard time finding how to add elements I need, and editing the properties of the existing ones. I've been running a test developing a website with no deadline and use Themler once a week. It's gotten a lot better, especially with the re-orientation of the menu to the top... it's looking more and more like an advanced Artisteer.

I like the layouts concepts, but I can't tell which works best with which joomla-layout, nor can I figure out how to assign them. I have to guess a lot and it's taking too long. I need to finish a clients website and adding the CSS file is the only way I know I can finish in the next two weeks.

That's why I'm asking for your help.

Thanks,

Bernard

Hi Stagger Lee, I'll be honest. I like Themler's concept and I think it's going in the right direction. But it's taken me the better part of 6 months trying it out and I still have a hard time finding how to add elements I need, and editing the properties of the existing ones. I've been running a test developing a website with no deadline and use Themler once a week. It's gotten a lot better, especially with the re-orientation of the menu to the top... it's looking more and more like an advanced Artisteer. I like the layouts concepts, but I can't tell which works best with which joomla-layout, nor can I figure out how to assign them. I have to guess a lot and it's taking too long. I need to finish a clients website and adding the CSS file is the only way I know I can finish in the next two weeks. That's why I'm asking for your help. Thanks, Bernard
Stagger Lee
1818 Posts
Stagger Lee posted this 16 February 2016

That is another problem. That you need to finish one website soon,
Cant help you with Joomla because i said farewell to it long time ago. Honestly I used K2 extension for things like this because Joomla is limited much.

It has to have some template hierarchy and order in wich core pick up filenames when calling specific templates.
Find this on Google and you did most of the work. For instance theoreticaly it could be template-your_category_name.php. And you got your Page styling.

That is another problem. That you need to finish one website soon, Cant help you with Joomla because i said farewell to it long time ago. Honestly I used K2 extension for things like this because Joomla is limited much. It has to have some template hierarchy and order in wich core pick up filenames when calling specific templates. Find this on Google and you did most of the work. For instance theoreticaly it could be template-your_category_name.php. And you got your Page styling.
bernardoa
4 Posts
bernardoa posted this 16 February 2016

Hi Stagger Lee,

It appears that Themler is not the product for my company to base our websites. Thanks for helping me make this decision.

Bernard

Hi Stagger Lee, It appears that Themler is not the product for my company to base our websites. Thanks for helping me make this decision. Bernard
Stagger Lee
1818 Posts
Stagger Lee posted this 16 February 2016

You will force me to test it and I hate Joomla. It cant be so difficult.

You will force me to test it and I hate Joomla. It cant be so difficult.
Support Team
Support Team posted this 19 February 2016

Hi bernardoa,

An example is to show a one color-theme for Services pages and different color-theme for Clients page, each with different appearance but using the same CSS classes and IDs. Does that make sense?

Themler theme includes a number of templates and you can add more if needed and assign them to the specific pages without manual coding:

http://answers.themler.com/articles/36343/how-to-work-with-templates-in-joomla-themes
http://answers.themler.com/articles/10804/how-to-create-and-use-custom-templates

Did you try custom templates?

Thank you,
Olivia

Hi bernardoa, > An example is to show a one color-theme for Services pages and different color-theme for Clients page, each with different appearance but using the same CSS classes and IDs. Does that make sense? Themler theme includes a number of templates and you can add more if needed and assign them to the specific pages without manual coding: http://answers.themler.com/articles/36343/how-to-work-with-templates-in-joomla-themes http://answers.themler.com/articles/10804/how-to-create-and-use-custom-templates Did you try custom templates? Thank you, Olivia
Denis L.
53 Posts
Denis L. posted this 27 April 2016

Hi, I have a similar problem with styling different templates.

Lets say I create 2 new " Default " type templates and name them " Template A " and " Template B ".
Now if I open Template A, then go to the Design tab and style the text links to be red... then I go to work on Template B and put the text links in blue for this one, the text links styles in Template A are also switched to blue.

There is no way to style separately two templates of the same type but named differently?

Hi, I have a similar problem with styling different templates. Lets say I create 2 new " **Default** " type templates and name them " **Template A** " and " **Template B** ". Now if I open **Template A**, then go to the Design tab and style the text links to be red... then I go to work on **Template B** and put the text links in blue for this one, the text links styles in **Template A** are also switched to blue. There is no way to style separately two templates of the same type but named differently?
Support Team
Support Team posted this 28 April 2016

Hi,

You probably edit the appearance of the links in the Posts control, in this case press the Customize Template Styles option in the top ribbon within the Posts control.

Sincerely,
Hella

Hi, You probably edit the appearance of the links in the Posts control, in this case press the Customize Template Styles option in the top ribbon within the Posts control. Sincerely, Hella
You must log in or register to leave comments