Layouting help

More
12 Jul 2014 14:11 #4708 by rowan
Replied by rowan on topic Layouting help
Hi Thomas,

Just thought I'd flick you an image of what I'm working on so see attached.

At the moment I'm including a css file within my layout eg I now have a tableflat.php, a tableFlat.xml and a tableFlat.css . Do you have any better suggestions as to how this could be done? I guess theoretically given that the css is relatively minimal I could do it inline? But you're the developer so I thought I'd ask you :)

Anyway this is becoming quite fun!

Cheers
Rowan

PS I might also try to work on some module layouts for the latest sermons module when I get the time.

Please Log in or Create an account to join the conversation.

More
12 Jul 2014 14:25 - 12 Jul 2014 14:26 #4710 by Thomas Hunziker
Replied by Thomas Hunziker on topic Layouting help
You forgot the attachement :)

I wouldn't use inline CSS. I would put the CSS file into a subdirectory of the /media folder and load it in your layout using
Code:
JHtml::stylesheet('your_subfolder/file.css', '', true);
For example you could put it into /media/sermonspeakerlayout/css/tableFlat.css and load it using
Code:
JHtml::stylesheet('sermonspeakerlayout/tableFlat.css', '', true);

This has several advantages: First your file will be cached by the browser and only loaded once, reducing the bandwith needed to load your page.
Second it allows to override the file in a template if someone else wants to use your layout.

Have a look how I do it with the example layouts. The manifest puts the file into the media folder here: github.com/Bakual/SermonSpeaker/blob/mas...lumns-layout.xml#L25
And it's loaded in the layout here: github.com/Bakual/SermonSpeaker/blob/mas...tmpl/columns.php#L15
Last edit: 12 Jul 2014 14:26 by Thomas Hunziker.

Please Log in or Create an account to join the conversation.

More
12 Jul 2014 14:47 #4713 by rowan
Replied by rowan on topic Layouting help
Yeah the attachment thing went a bit haywire, something stupid I did on my end!

Thanks for the tips re the stylesheet, I'll give that a whirl.

Cheers

Attachments:

Please Log in or Create an account to join the conversation.

More
12 Jul 2014 14:53 #4715 by Thomas Hunziker
Replied by Thomas Hunziker on topic Layouting help
Looks nice indeed!

Please Log in or Create an account to join the conversation.

Time to create page: 0.099 seconds
Powered by Kunena Forum