Making a different type of home page in Orchard - model-view-controller

I've just started with the Orchard CMS and I can see that I can create a page and have different widgets on them, but I need the homepage to have a different layout.
I'd like to have some sort of different cshtml file for the homepage, but I can't seem to work out how to do it from the documentation. I also need to have four text areas on the home page that aren't on the main page.
Can someone who has done this point me in the right direction?

You should use designer tools module if you are using Orchard 1.1 +. Just search for Shapes in the admin and install the tools. Then you can create Alternates by reviewing the shapes in-browser.
In your case you should be able to create a view with the name: Content-url-homepage.cshtml

This may help you, it's a post I found about making your own themes and is a fairly simple example but covers what you are looking for:
http://www.nogginbox.co.uk/blog/theming-orchard
/Views/Content-11.cshtml
I wanted to display the content on my
homepage slightly differently than
other pages. My homepage has an ID of
11 so I was able to reference it with
a file called Content-11.cshtml. I
could also have created a template for
all blog post content using a file
called Content-BlogPost.cshtml had I
needed to do so.

You can try this to vary the homepage layout: http://weblogs.asp.net/bleroy/archive/2010/12/14/switching-the-layout-in-orchard-cms.aspx
Orchard 1.1 will also give you a homepage alternate out of the box.

Related

How to create a single page vertical scrolling site in Joomla

I can create a standard Joomla template in my sleep, but recently I had a client come to me who wants a vertically scrolling, single page site. I whipped up an HTML/CSS mockup that functions beautifully but I have a question re: converting it to a Joomla template:
Do I just create a single article in Joomla that contains all of the content for the single page, and then create menu items that link to the section divs?
Many thanks,
Cynthia
yes I think that good , also you can make all items in "index.php" in template folder and make menu items link to divs by "#" plus ID .
you can add all items you want as module and you can use component in modules plugin lik :
http://extensions.joomla.org/extensions/core-enhancements/coding-a-scripts-integration/embed-a-include/18121
Hope that help you
You'd be better to insert the content via creating a bespoke module or component - putting code in the WYSIWYG area kind of defeats the point of using a CMS at all - someone with no coding skills has to be able to update the site and not accidentally delete the layout.
I'd perhaps question why it needs it to be in Joomla at all, though. It doesn't sound like it will be benefiting from many of its features.

No horizontal navigation showing on Magento custom theme

I have decided to sit down and build my first custom theme in Magento and I'm using this tutorial: http://net.tutsplus.com/tutorials/php/magento-for-designers-part-4/
However I cant for the life of me find a way to include horizontal navigation (Home | Shop | Contact etc.) along the top of my website!
I tried all the suggestions I could find including placing everything in the root category and enabling all cats in the navigation.. refreshing the cache etc.
I've been working at this for hours now and been searching everywhere for an answer. I've pretty much followed the tutorial step by step but I can't see any way to enable the Nav - can someone please point me in the right direction with this?
(I'm kind of assuming Magento have a way to do this to add categories automatically - I'm aware I could hard code the navigation bar but I'm trying to avoid this.)
Looking at the screenshot on the tutorial, it doesn't actually have the menu anyway.
I'd recommend you check out leveluptuts magento theming tutorials, who actually take the base theme and manipulates it into the desired theme. I think you'll have much more luck that way as most of the templates and layout files are already built.
http://leveluptuts.com/tutorials/magento-community-tutorials/25-theming-magento-1-intro-theming
For the top menu, the default theme pages call the "header.phtml" template for the header block (app/design/frontend/base/default/template/page/html/header.phtml), which in turns calls the "topmenu.phtml" template (app/design/frontend/base/default/template/page/html/topmenu.phtml) where the menu code is.
The layout files is page.xml
Hope this helps!

Custom data in pyro cms pages, such as images or other data

I'm wondering how in PyroCMS I can add a custom field to a page. Ideally I would like to have an image area at the top of the layout, and have a custom field in pyro that would allow someone to populate that image from the pages module. I realize that there are some image plugins that allow me to attach images to pages, but I would like to be able to add the images directly into the page in the admin (as well as other custom fields for the pages). Even on a separate tab would be fine with me. I'm fine building something if someone can point me in the right direction.
Currently if you want to add a custom field to a page you have to hack the module. This is obviously not ideal and im not really suggesting it, but I had to do it for http://tedco.org/business to add a "Subtitle" field to each page.
2.2/develop is having its Pages and Blogs moved over to Streams, so you can add custom fields to all pages globally, meaning you can add an image in if you like, or append a US State for some reason, or add a slider. Whipee!
So right now: Hack it or wait. 2.2/develop will have your feature in a week or two.
I'm not sure you can do this directly from the pages module yet or not without some customization (possible hacking) though, I just asked and will update if possible.
In the meantime this might be helpful:
Consider looking into PyroStreams. for this though, it will require the Pro version of PyroCMS or you can purchase it from Parse19 directly.
You might find this article helpful about organization and page layouts.
Here is an article called Dynamic Pages with PyroCMS and PyroStreams though, it's a bit outdated now.
You may also make use of the gallery module, which is free though, I'm not sure this will meet your needs.

display custom attributes on Virtuemart browse page

I need the browse page to show quantity box, custom attributes, and Add to Cart button all together.
It doesn't show it at all. Only when you go to the product page, you can see them.
Any solutions?
Thanks, Ahmed.
Ahmed, you'll have to modify the template directly to do something like that. VM uses a large number of template files written in PHP. If you're using the default template, you can find them here:
components/com_virtuemart/themes/default/templates/
From there, it takes a little looking around to figure out exactly which template you need to edit. If you need to edit a browse template, my recommendation is go to your VirtueMart Administration in Joomla backend and look at Admin | Configuration | Site | Layout to get an idea of which files you're using. It will probably say "Default" in the dropdown, with a Configuration link directly below. Click that link and look at the very first item, Product List Style. From the description of your layout desires, you might be using Flat Product List.
The main file for editing that layout is:
components/com_virtuemart/themes/default/templates/browse/includes/browse_listtable.tpl.php
If you're a programmer, you should be able to look thru the code and correctly guess which code elements are being used to display VM product details. If you're not a programmer, you can still fake it by commenting out sections to see what "goes away" on the actual product page. Use what you learn to strip out useful code and move it around.
Another useful file to pull VM product code from is:
components/com_virtuemart/themes/default/templates/product_details/flypage.tpl.php
This is the actual product view (unless it's been changed in VM config), and contains pretty much all the common code elements that extract product details. You should be able to lift some of that code and place it where it needs to go in other forms.
Good luck with all of this. I find VM coding painful, and community support in the VM forums can be... sparse...

How to have custom sidebar content per article in Joomla?

I'm in the process of porting an existing website to Joomla. Most pages of this website consist of a main content area and a sidebar containing additional items relating to the main content, such as (in-page) links, images, additional information, etc.
In Joomla, the main page content would probably be an article, but I'm not sure what would be the best way to create the sidebar content in Joomla.
Examples of pages-with-sidebar:
http://www.aikikan.nl/en_watisaikido
http://www.aikikan.nl/dojo?id=2
I'm creating a custom template for this website, so any solutions that require modifying the template are fine as well. What would be the best way to set this up?
Keep the content of each sidebar in an article and then assign it to a module by means of the article-as-module extension. You can then control the scope for each module (i.e. choose menu postions for which it will be shown) in the admin interface.
There is an extension called meta mod which is perfect for this sort of thing. It allows you to show modules based on any condition you can evaluate with PHP

Resources