Where to put grid layout in SUSY/SMACSS structure - susy

say on the about page you have 3 column grid and on the home page you have a four column grid, in which file within the css architecture should these styles be placed to layout these pages, should each page have a layout css?

I, personally, only use one layout file and put whole pages layout styles here, more easier to maintain.

Good question. However, adding a specific css file for specific pages would greatly negate the purpose/power of SMACCS. All of your layout structure should be in one 'layout' css file or better yet defined within a custom (or not) mixin which you can call based inside of a module or overall layout.

Related

What is Sitecore Datasource and why should use?

I'm new to Sitecore XP 8.2 and try to study by articles and youtube.
However, I can't figure out why we should use datasource, instead of having multiple items in the content tree? How can I enable Global on the content tree?
If you by 'datasource' means 'Rendering Datasource Location' heres a real life example, where using datasource is helpfull, instead of having data items underneath each page item.
Lets say, you have a Footer module, which you would like to include on all content pages in your website. And the Editors should be able to change the content of the footer module on all pages, but the effect should be global.
In this case, could a solution be, to make a folder at the top of your tree structure called 'Shared Modules', and point the 'Footer Rendering Datasource Location' at this folder.
In case an editor changes the footer text on the main page or a subpage, the effect will allways be saved in the same location.
unlike, a 'Texbox module' which you would like to have multiple of on multiple pages. these would you like to have placed underneath each of your content pages in a folder e.g 'Page Modules'.
You can use Sitecore Datasource for a variety of reasons. One of the reasons is to use this instead of context item so that you can refer to another item in Sitecore content tree. Another good reason is to personalize your content or run the A/B testing, content testing. Using Sitecore datasource, make different parts of page componentize and all this helps content editor to improve experience in content editor.
For some good information on using Sitecore datasource, you can look at
https://www.linkedin.com/pulse/how-improve-experience-editor-sitecore-number-ways-rohit-chopra
https://www.linkedin.com/pulse/sitecore-personalize-content-conditional-renderings-sub-rohit-chopra
In short, with datasources you can re-use your items, makes your life much easier if you want to go with personalization and its easier to manage in terms of security/workflows.
A datasource is a pointer from your presentation to a content item. This item can easily be picked from a global or local placement in the content tree. You can still navigate from the datasource to other items (like subitems) if you want a more complex structure for your content.
The advantages of using datasources, is that Sitecores presentation engine, Experience Editor and marketing/personalization is based on the usage of datasources. Further you cater for reuse of content, as multiple presentations can point to the same datasource item.
By using datasources you decouple the content from the structure of your content tree and hierarchy.

Joomla 1.5 2 categories, 2 layouts

I have two categories that need their own layout. Right now it looks like both categories are using template/html/com_content/category/blog.php, and I can't for the life of me figure out how to switch this to a different layout from the menu item layout selection.
Joomla 1.5
Stuff I have read:
http://docs.joomla.org/Understanding_Output_Overrides
http://docs.joomla.org/How_to_override_the_output_from_the_Joomla!_core
No matter where I place extra files within ...my-template/html/com_content/category or ...my-template/html/com_content/category/views/[category]/[tmpl]/, no new layouts show up from the layout selection dialog. System debug doesn't seem to print out any useful templating info either.
WHAT DO?
You put layout overrides it the html folder of your template not in the core folders. Look at beez5 for examples of layout over ride and also for an alternative layout which is used in com_contact.

Liferay 6 - How to set up custom layout as default?

I'm working on a Liferay 6 project, and part of the project is to create a new layout template to be used for the entire site as the default. Liferay's own wiki is very sparse on documentation about layout templates, and I haven't had better luck with Google searches or even here on SO.
I did find one article ( Liferay - Layout for each pages ) that sort of answers the question, but it seems like it might be overkill. In that question, the goal was to change the template based on the page, so the answer was to create a Hook and use that to set the template on the fly as needed. Here, I just want to have this custom template be the default for all pages, all the time, which is why I think the answer to that other question might be more than is really needed.
If anyone has the answer to this puzzler, please let me know. Thanks!
-- JLM --
OK, I've figured out my confusion. Liferay has two types of layout templates -- templates that are part of a theme, which is one type of Liferay project, as well as actual layout template projects themselves.
The templates in a theme are where you set up the overall page layout for the site. The main page template, named portal_normal.vm, is a full web page with an <html> tag, a <head> and <body>, etc. Other templates in the theme are usually page fragments.
A Layout Template, on the other hand, is only for laying out the portlets in the main content region of your page (which is defined by tags in your Theme's template files). It is always a fragment and can only have <div> elements or a <table> for laying out the portlets.
Fortunately, this actually makes answering my question very easy, at least in the context that I needed. Per Liferay's documentation at http://www.liferay.com/community/wiki/-/wiki/Main/How+To+Change+Liferay+Default+Theme :
Note: As of 6.x, you cannot just use the theme id specified in the liferay-look-and-feel.xml. Instead, go to Control Panel->Plugins Configuration->Click on theme of interest->note the Plugin ID and use that [as the value for default.theme.id in portal-ext.properties]
I hope this helps some other people trying to figure this out!

Magento -how are pages differentiated?

I'm a little confused with the way Magento implements web pages, and I'm hoping someone here can help me out.
I've figured out how to adjust themes and templates, etc., but I'm wondering how I implement content with them.
There is a disconnect in my understanding of how to put content into a page. Is this done with the layout and template files, or is this done on the cms page?
I've been searching for tutorials, etc., and I'm having trouble finding them (maybe I'm using the wrong terminology), so if you know of examples or anything that might help, I would really appreciate it.
Thank you in advance for your help!
Magento design/template is a broad question, which may appears tricky at first, but so logical and powerfull once you get to know it.
In a nutshell, the .xml layout files are responsible for defining the content, and the phtml (in relation with their Block classes) actually render the html. Everytime a page load, all the layout files are parsed to retrieve all the blocks which have to appears in this particular page.
The content loaded in each page is defined by the handles in the layout files, which correspond to the module/controller/action. For example, the content of the customer's account index page (which is the result of the index action, of the Account Controller of the Customer module, see the logic of the handle's name) is defined by:
the blocks/layout defined in the <customer_account_index> handle of app/design/PACKAGE/TEMPLATE/layout/customer.xml
the blocks/layout defined in the <customer_account_index> handle of all other layout files (I'm not saying that all layout files have a <customer_account_index> handle, but those who have it, like poll.xml, will insert their content)
the blocks/layout defined in the <default> handle of all other layout files, that's why it's called "default" :)
When you say:
is this done on the cms page?
I assume you're refering to the cms in the admin: this only take care of the content block of the static pages of your store. And the rest of the page is still defined by the xml (the page.xml handle of the cms page's layout (1 column, 2 columns-left, etc...) handles like <default>, <cms_index_index>, etc...) But even there, you can modify the layout by putting content in the proper textareas.
Here are some interesting links to understand the magic of Magento's layout:
Demystifying Magento’s Layout XML
Magento for Developers: Part 4 - Magento Layouts, Blocks and Templatese
No Frills Magento Layout by Alan Storm
Designer's Guide to Magento
HTH

Using layouts/elements in Cakephp

I am developing a webapp using Cakephp. I have created a default layout for the website. I created sections like header, footer, content.
Now some of the pages in my content section have same structure. These are part of a controller with various views defined for each page. What view template should I be using here? Layouts or Elements?
In case I use layout, I will be using the controller to decide the layout I will use, but won't that change the layout for whole website?
Regards
This is really a matter of preference. I try to think of layout as the "structure" of the page -- so a header, placeholder for left nav, placeholder for top nav, footer. That kind of thing. I define those sections in the layout.
I'd recommend the "pages in my content section [that] have the same structure" be your layout. As you mentioned, you can switch layouts in the controller, but any similarly structured pages (pages that will look the same as each other once you've removed the content) I would have share a layout.
Another example of layout switching could be for logged in versus anonymous users. For a logged in user, websites frequently put a "Welcome, $name" message at the top, along with links to My Account, sign out, etc. I often find myself using a different layout for logged in versus anon users. ALso, in that situation, I use the beforeFilter() method to set the layout for a given controller, since I know whether the user is logged in or not when that callback is executed.
Sorry for the rambling, but this is a bit of a gray area (when to use a layout versus different elements).