ModX: Display multiple pages on one page? - blogs

I have a ModX site and I was wondering if it is at all possible to display multiple pages (including their templates and TVs) on one page? Kind of like a blog?
If anyone could help me out that would be great!
Tnanks

What you're looking for is a plugin like getResources.
It will let you loop through a list of resources like so:
[[!getResources? &parents=`[[*id]]` &tpl=`myRowTpl`]]
Where the &parents is the parent resource of the items you'd like to list out, and &tpl is the template that would be rendered.
If you're showing TVs don't forget to use
&includeTVs=`1` &processTVs=`1`
There's tons more info on the modx docs.

Related

SEO Single Page Applictaion

i like singlepages with anchors but i have seen, that site:domain.com only show one result on google.
my sections are like
<div id="section">content...</div>
and my links are like:
section link
is there a way to build the singlepage a other way to get a result for each section? i dont like to use any frameworks...
I think the only way now is to pre-render the website on your server, using something like PhantomJS and serve the result to the Google crawler. Creating a sitemap can also help.
With no URL change and all the content in the HTML document - Google will only see one page.
Google indexes complete web pages. It will not separately list anchor links to the same page.
Either split your document into multiple pages or paginate content using different URLs.

squarespace query only for home page

I am using squarespace developer kit and going well. I am wanting to integrate some queries to display some very simple data form my blogs that will appear on my home page ONLY.
Not being very fluent in JSON, I am struggling to implement the query on the home page. I have it set up to display the data from the selected blog but it displays the data through each page.
I only want the data to be visible on the home page at the top. Not in the header but inside where all the content is.
Here is my query that works perfectly well
<squarespace:query collection="feature-articles" limit="10">
<li>
{.repeated section items}
<li>{title}</li>
{.end}
</li>
</squarespace:query>
Can the data be inserted into a code block via the content manager so I can then insert into within the content or am I totally wrong in thinking that.
What I will then do is style/ add or edit the UI of the data into either a carousel or whatever is needed for the project.
I just need to know where to store the query so that it fits in with the content.
Appreciate any time.
Review the following link to see how you can edit a template file, to make different pages use different templates.
http://developers.squarespace.com/template-configuration/
Make a completely custom template just for your homepage then paste you code within your custom .region file as outlin ed in the above guide.
Here is the page about working with template pages:
http://developers.squarespace.com/layouts-regions/
Seeing as you know about , I have a feeling you might already know this, so you might want to be a bit more specific about how your displaying your code and I will gladly update my answer.

Joomla article with custom buttons and images on the right

I have to create Joomla website. I am PHP programmer, but new to Joomla.
I have spent a lot, reading tutorials and other staff.
The website is very simple, it is visit card for restaurant.
I have installed Joomla 2.5. Spending two days I have managed to do the following:
- create menu
- create multi language site (2 languages) with language swicher
- create simple static pages (articles)
- create one page as contact
- create simple template just for my website
However, I cannot do some things and I have not found any answers in tutorials or google.
If you open this file http://img1.uploadscreenshot.com/images/orig/1/2621034793-orig.jpg you can see images with three different pages on the site:
1) Article with three images on the right.
Basically, I do not know what is the best practice to create article with some custom HTML in it (in this case these are images). For example, i can create table with two columns - one for text, another for images. Without Joomla I would create two divs, but how this can be done here??? Also with custom html I need to do the same for each language - I need to add images for each language, I do not like this. I really have not found any solutions for this. Do you have some suggestions?
2) Article with three buttons on the right side. This is article on landing page.
This is probably the same question - how to create article with some custom HTML in it (in this case these are three buttons - links to pages inside the website)? Again I can create table with text and buttons, but this should be done for each language. Is it a good practice? Do you have some other suggestions to create article with three buttons on the right side? Maybe I can create some custom module, but this sounds strange.
3) Contact page with google map.
I have create contact page with contact details. This is another question, I would ask other time.
Hello Renathy and welcome to Joomla!
1) You can of course insert divs in the editor and style them with floats; but as you mention this is pretty bad for translation, and allows the user to easily break the layout.
You have the following options:
1.a)
Joomla 2.5+ supports an article image and thumbnail that you can specify in the Images and Links group for each article. Quite some work to extend to 3 images, you would need to write a plugin (or do a nasty core hack) and override the view; also it's not well documented. There is a discussion here about it: Add additional images to articles in Joomla 2.5
1.b)
Add the extra images as above with the plugin. Then use a module for displaying the images instead of the view override.
1.c)
Use a custom image management solution to link images to an article, then a plugin to display them. Easier, but still a lot of work. I have done this on one site and worked fine, although I would change a lot of code now. As far as I know there are no extensions available that will do this.
All three solutions allow you to use proper floating of the contents using divs floats responsive as appropriate, and will isolate the layout of the content from the images, thus obtaining a solid environment for the content editors, and easy translation (although, if you go with 1.a) or 1.b), I strongly advise you to use a proper translation suite such as Falang or JoomFish (Falang is a different port of Joomfish from the old 1.5 version)
2)
You will address this as above, with a module.
Create in your template a main
<div class="content-box">
<div class="content-main"> here you will place your component's output.</div>
<div class="content-sidebar"> here you will output a new module position, name it "article-sidebar"</div>
Then style it like this:
div.content-box {
/* here you need a clearfix choose one here: https://stackoverflow.com/questions/211383/which-method-of-clearfix-is-best/211467#211467 */
}
div.content-box div.content-main {
width:70%;display:inline-block;float:left;
}
div.content-box div.content-sidebar {
width:29.99%;float:right;
}
div.content-wide div.content-sidebar {
display:none;
}
But you may not want this on all pages, then you can deal with it programmatically when generating the template.
The idea is: in your template output, where you are writing
<div class="content-box">
instead add a class conditionally when your article-sidebar contains something:
<div class="content-<?php
if ($this->countModules("article-sidebar")==0)
echo "wide";
else
echo "box";
?>">
This will dinamically change the class of the div, so you only serve 1 css.
At this point, create a module and choose to display it "Only on selected pages" .
3)
When you want to change a view, never change the file in place. Instead copy all the view's php to a folder under your template's folder / html/com_contact/contact. Even if you're changing a different layout, you will still need to copy there the default.php.
Then change it inserting the google maps.
A final consideration. You should refrain from editing core files. Joomla sometimes issues security updates, and applying them will be painful. Good luck with your site.

Index page in Joomla

I have made a homepage in Joomla 2.5, and I need my front page to be different then the page made in Joomla.
My best solution then, is to make the front page in pure HMTL, and then redirect to the site made in Joomla. Is this possible? or is there an easier way to do it? for example with a plugin or something?
Create a custom html page and create it an article and then assign this article to front page. In this way you can display your custom html page to hope page of joomla.
Further if you want to remove even the headers and footers of the joomla page for home page this can be done in various ways
Make module positions and display the header and footer in it an
then in admin do not publish these modules for home page
We have
variable in template index.php which give us flags weather this is
home page you can use this flag and put a condition like if this is
home page dont display the header and footer.
Hope it will help you.
I can't really understand your question. If you want to load HTML only use custom HTML module rendered in your homepage
What are you trying to achieve? Without knowing more, I have two thoughts.
a. Joomla uses index.php. A lot of the time web servers look for index.html first. So if you create an index.html file and upload it to your root folder, it will display that first and not read your Joomla! site. If that doesn't work, check your web server to see the order that it looks for your start page. That is a setting that can be changed. (Depending on your hosting situation)
or b. You can set different templates for a single Joomla! site. you could set a different template for the homepage compared to the rest of the site. (I just need to know more on what you are trying to accomplish)
Have a great one.

Orchard CMS - theming

I have some questions regarding theming Orchard CMS. So, let's begin... I have a website that will have 5 pages and some of them have different layouts.
Pages and zones within it:
Homepage - Content, TripelFirst, TripelSecond, TripelThird
Concept and Rentals page - Content, AsideFirst, AsideSecond
Press and Service Department page - Content, AsideFirst, AsideSecond (different layout then the previous two pages)
Note: Even though all of the pages have the Content zone, except Homepage none of the pages uses it. Other pages only have HTML widgets located in one of the zones.
1) I've read that it is possible to create the layout for the specific ID, the problem is I can't find that ID to create the layout for specific ID.
2) As you can see, couple of pages have the same layout, how to assign them to the specific layout? For example, if I create the layout for Concept and Rentals page how can I assign the specific layout to them and also how can I assign the layout to Press and Service Department pages?
3) How to add the class tag to the body? The problem is that Orchard CMS creates the body before everything else so it isn't contained in the layout cshtml files.
Thank you in advance!
when you edit the page in the admin, the url will look something like http://localhost:30320/OrchardLocal/Admin/Contents/Edit/16
16 is the id here.
Several things you can do. Easiest is to use this module: http://orchardproject.net/gallery/List/Modules/Orchard.Module.Downplay.Orchard.LayoutSelector
Alternatively, you could programmatically create alternates based on arbitrary criteria: http://weblogs.asp.net/bleroy/archive/2010/12/14/switching-the-layout-in-orchard-cms.aspx
Finally, you can often avoid to have to create an actual separate layout by just varying what widgets go where, using layers.
The body tag is in document.cshtml, which you can override in your own theme.
1. Not sure what you mean by ID? If you click Widgets on the DashBoard, there are Layers there. A layer is a collection of widgets that will activate for a specific thing, Like the authenticated Layer will display those widgets you define when a user is authenticated.
Expanding on (1) and for (2), you will be able to create a new layout by adding widgets to a layer.
Check out:
Tagged Layer Rule - Allows you to add widgets based on a tag. Now, you can add pages for concepts and rentals and then specify a layer for these tags, within that layer, you can add any widgets you like. These will only appear when that tag is encountered.
Also check out:
Content Type Layer Rule - Haven't tried this, but it falls on the same lines.
3. To customize the look there is something called Shapes. Each Zone I think has a corresponding cshtml files. You can even use the ShaperBuilder to even render html in code, again, don't know too much about this but I can tell you, you need to look into these articles.
Using shapes as Html helpers in Orchard
Using shapes as Html helpers in Orchard
Taking over list rendering in Orchard
Dispatching Orchard shapes to arbitrary zones
HTH, I'll try and contact some orchard folk that are on SO.
So to help you out here
The ID of the Home Page is always 11 for a fresh install though I imagine that you can delete the home page and create a new one and give it another ID. To find the ID of the other pages open up the DB and look at the Content Items.
I know of no way to apply Layouts other than by ID so just duplicate the layout pages as you have so few pages.
I would just use a small jQuery script
$(document).ready(function{
$('body').addClass('SomeClass');
});