Path to layout xml files in magento - layout

I have seen that we can place our layout xml files in
app/design/frontend/default/default/layout
or we can place our customization inside
app/design/frontend/base/default/layout/local.xml
file, but I have read at magebase and at magentocommerce that we can place our layout files under
app/design/frontend/your_interface/your_theme/layout/
or
app/design/frontend/[package]/[theme]/layout
So if we I have package like 'Kaushikamdotcom' in 'app/code/local', should I have to create that same package under 'app/design/frontend/' ? I tried many patterns, but nothing worked out for me.

I am quite sorry that I have made such a blunder asking this question, but I am answering this as lots of people will be making the same mistake. Package means; in the admin side of magento open
System->Configuration->Design
Then change the configuration scope to Main website. Then select Package section, uncheck the default check box and use your package name such as "Test". Then create the following folder structure.
app/design/frontend/Test/default/layout
Place your layout xml files here. If you are using your own themes use that name instead of default.

It depends what layout-xml file you have.
If you want to build up your theme, use the local.xml file in your theme dir.
If you write an extension and want to add a block to use inside this new extension, add a layout-xml file via config.xml and add it under base/default/layout/yourname.xml
When you do it this way, your theme-related changes only appear in the theme and your extension-related changes are theme-independent

Related

__layout.reset has been removed in favour of named layouts

I have a page set up in this format
original reset image›
I looked at forums and it said i should change the inner layout page to __layout#reset.svelte. However when i do that, I get another error.
reset image using #reset instead of .reset
Does anyone know how i can put in a reset __layout inside of a folder and get it to override the parent layout?
Your error is because __layout#reset.svelte would be looking for a __layout-reset.svelte file in it's current directory, or any parent directory directory, to be a sub-layout for. You don't have a __layout-reset.svelte file.
As Thomas Hennes mentioned in the other thread. If you wanted to have it act like the reset, you'd need to create a __layout-reset.svelte file in the current folder or (more useful for the entire app, in the root folder) and have it be a blank <slot />. From there, you can do __layout#reset.svelte to which will allow you to make a completely new layout.
I think that you can solve this problem by fallowing this steps :
Create "__layout-choseNameYouWant.svelte" at the same level as "__layout.svelte"
Create "guides#theSameNameYouGaveForLayoutFile.svelte" at the same level as
about.svelte
Layouts can themselves choose to inherit from named layouts
create "__layout-root.svelte" at the same level as index.svelte and about.svelte with the following code
<slot/>
create "__layout#root.svelte" in guides folder with the following
<slot></slot>

Enabling Resource Aggregation with Bootstrap 3

I'm using Bootstrap files within my application and I want to enable "Use runtime optimized JavaScript and CSS resources".
the problem I have is once enabled; glyphicons-halflings-regular.eot, glyphicons-halflings-regular.svg and glyphicons-halflings-regular.woff cannot be found:
I know for Bootstrap 2.3 we could use a Theme that loads a .CSS file that changes relative locations as described here http://www.bootstrap4xpages.com/bs4xp/site.nsf/article.xsp?documentId=F435B6DC54486B67C1257B6B002E5A6C&action=openDocument
So, what should I do to handle relative locations with Bootstrap 3?
You have to tweak the path to the web font resoureces in the Bootstrap CSS files.
Delete the part with "../" and replace it with the relative path to the font files within your project structure, e.g.
bootstrap/fonts/...
Then aggregation will load the fonts correctly.
This does not answer your question but if you want to use Bootstrap 3 you'd be MUCH better off using the Boostrap4Xpages project on OpenNTF.org. It will perform better and the resource aggregation will work better. It's easy to install and use but it is a plugin on the sever so that needs to be done. It's not self contained to the NSF. Try and move to this if at all possible.
Regarding the actual question. I'm not sure I know the answer specifically. I do know that using relative links can sometimes be a problem if the browser's URL doesn't have the page.xsp portion. So it works on the page.xsp and NOT the default launch XPage where the URL ends with the database.nsf. What I've done in the past there is set the application to launch to something like "start.xsp" and in that page in beforePageLoad to a redirect to "home.xsp". This forces the browser url to always show the page name and made life a little easier when dealing with adding projects to WebContent.

How can I specifiy an alternate layout for NotFound.cshml and ErrorPage.cshtml in Orchard CMS

I know you can use layout filters for normal pages with urls, but upon errors the view changes while keeping the url the same, so I can't utilize a new layout based on the path. Any help would be appreciated. Thank you!
Off the top of my head:
If you look in Core > Shapes > Views, you will see two files - one called ErrorPage.cshtml and one called NotFound.cshtml. Simply copy these files and paste them into your theme's view folder.
I have not tested this method with these particular pages, but I did do something similar with the LogOn widget.
Something to bear in mind is that the contents of these files will be rendered in the Content zone of your current theme.

How to add extra css to SharePoint 2007 site without reverting back to default theme

Currently I'm having trouble adding custom/my own css files to my SharePoint site. I add the custom/my own css files via the c# files (CssLink) as a web part and have them applied to my site's javascript files. Trouble is, whenever the css files were applied, my site goes back to the default blue-ish SharePoint theme color.
Is there any quick and simple way to avoid that from happening?
Thanks.
You can use this method to register a css file from a WebPart
Microsoft.SharePoint.WebControls.CssRegistration.Register("/.../mystyles.css")
or you can add the css file to the content place holder with the id "PlaceHolderAdditionalPageHead" which is present in the master page like this
var placeholder= Page.FindControl("PlaceHolderAdditionalPageHead");
var cssLink = new Literal();
cssLink.Text = "text";
placeholder.Controls.Add(cssLink);
Why don't you use, Site Settings, Master page and use the option "Specify a CSS file to be used by this publishing site and all sites that inherit from it." to specify your own CSS.
(Also, I have no idea what you mean with "via the c# files (CssLink) as a web part and have them applied to my site's javascript files". Are you missing some words in that sentence?)
You should have a very good reason to be adding CSSLink via C#. Have you considered packaging your CSS as your own theme?
SharePoint themes are easy to create and have many benefits such as:
a) Supported by Microsoft
b) Easy to create
c) Manageable by the end users.
d) You can apply different themes to different parts of the site.
e) etc etc...
The process of creating the theme can be found here:
http://sharepoint.microsoft.com/blogs/GetThePoint/Lists/Posts/Post.aspx?ID=122
I would recommend adding your theme via a feature only for adding and removing the theme. This would add a great deal of options for future tweaking.
Here is an example:
http://www.devexpertise.com/2009/02/11/installing-a-theme-as-a-sharepoint-feature/
I'm going to blog about this later this week so keep an eye out of you like. http://blog.zebsadiq.com
Upload your css in the syle library folder(or any library in side your site)
go to -->site actions-->site settings-->modify all site settings-->under look and feel tab-->click master page-->there is one option called alternate css url-->browse your custom css and click Ok.

silverstripe - adding styles to 'styles' drop down menu on editor

from the question above, I thought it would be relatively easy but i can not find any documentation on on how to add styles to the 'styles' drop down menu. can anyone push me in the right direction?
The styles dropdown is automatically populated based on classes found in your theme's typography.css file. To add classes, just ensure that they are defined there. Alternatively, if you want to give the classes friendlier names or to remove some classes from the list, you can explicitly define the styles that you want listed by putting this in your _config.php file.
HtmlEditorConfig::get('cms')->setOption('theme_advanced_styles',
'Name 1=class1;Name 2=class2');
It's a feature provided by TinyMCE, the WYSIWYG editor component, and this line is just setting the theme_advanced_styles setting of TinyMCE when used by the CMS. This thread on the TinyMCE site also discusses it.
Also note Markus' answer below: editor.css needs to be in the theme css folder and include the typography.css.
The answer of #Sam Minnée only works, if the editor.css is also in the theme css folder and includes the typography.css.
Here is a more detailed description of how these two play together.
If you have troubles getting the new styles appear in the editor, try the following:
yoursite.com/admin/?flush=1
Check the file permissions on your mythemes/css/editor.css file. It should be readable by the webserver user.

Resources