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

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.

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>

How can I specify a background image for a content query Webpart in SharePoint 2010?

How can I style the background of a content query webpart in SharePoint 2010?
I have been having a look around, and can't seem to figure it out. I am able to edit the individual item styles using the ItemStyle.xsl file in SharePoint designer, but I need a background image on the container.
I have referenced the class that is generated by SharePoint - 'WebPartWPQ4' - in CSS, and made it work that way, but that changes the styles for all web parts in the system. (This also feels like a bit of a hack)
Any help would be greatly appreciated.
It is totally okay that you try to override custom styles in your css (although 'WebPartWPQ4' is not the best choice). However, to get what you need, just ensure that the web part you want to style has some wrapper around it and change selector in your css to .wrapper > .WebPartWPQ4 so that only this instance of the web part gets styled.
The way I have solved this is to wrap the webpart zone in a div in the .aspx page file.
You can then reference this div in a css file.

Use image buttons for pagination - Drupal

The default pagination in drupal is great, but the text links are used
<<first <previous 6 7 next> last>>
But I need to use forward and backward image buttons instead of text links. Can anyone point me in the right direction?
Depending on what portions of the pager you're interested in replacing with images, you may be able to use CSS background images, without having to override the theme function. However, in the default pager output, not all the links may have unique classes.
That said, if you're using Drupal's default pager, you can override the theme_pager function to add your image links.
If you're using the Views module, you may be using a different theming function. When in doubt, you should be able to use the Theme Developer module to find which function or template file is outputting the part of the page you're interested in theming. Theme Developer will also tell you what suggestions you can use to override the output.

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