Automaticaly show short version of a range of pages on one overviewpage
Hi,
Is it possible to show a short version of let's say different project pages on one overview page.
So e.g. you have all these different projects and you wish to provide your website visitor to have a landing page of all these projects where they can see them all in a short version (4-5) lines, picture and read more link to the projects listed.
Then when the page gets too long, there would be pagination put in place.
Yes it´s possible to a short version of let's say different project pages on one overview page in Umbraco. For an example of this you could setup an new Umbraco installation and choose the starter kit called TxT.
@{
// Model.Content is the current page that we're on
// AncestorsOrSelf is all of the ancestors this page has in the tree
// (1) means: go up to level 1 and stop looking for more ancestors when you get there
// First() gets the first ancestor found (the home page, on level 1)
@* var homePage = CurrentPage.AncestorsOrSelf(1).First(); *@
var homePage = Umbraco.Content(1081).Children.Where("Visible").OrderBy("Name");
Do you have a structure where you have an overview page document type, and under this page you have each product page. Then you should be able to use this snippet of code.
Okay so you are using the grid layout. Then you need to create a row configuration that has an image on the left and the description on the right side.
If I turn off truncate, then I get the whole gridpage, which I do not wish for.
I have Umbraco TV. But this is something beyond the already provided information (I think).
As you can see (and understand) in the provided picture, I have no need for the searchbar and side navigation in the overview pane.
One of the limitations is All content entered into the grid is stored as a single property value on the content node, as a big JSON object. This means that as soon as the values are stored in the database, there is no managed api to drill into the grid content and target specific cell content - so a grid layout is not a recommended storage of reusable content - it simply wasn't designed for this scenario. If you wish to reuse content in multiple pages, it is still recommended that you store these pieces of content as separate content nodes, so they can be stored, cached and queried as usual.
I'll play around in my grid settings and throw out my sidenavigation from the grid and put it in the template itself.
That will probably force my grid to only show project related stuff.
Automaticaly show short version of a range of pages on one overviewpage
Hi,
Is it possible to show a short version of let's say different project pages on one overview page.
So e.g. you have all these different projects and you wish to provide your website visitor to have a landing page of all these projects where they can see them all in a short version (4-5) lines, picture and read more link to the projects listed.
Then when the page gets too long, there would be pagination put in place.
Is something like this possible using Umbraco?
Thanks!
Laurens
Hi Laurens,
Yes it´s possible to a short version of let's say different project pages on one overview page in Umbraco. For an example of this you could setup an new Umbraco installation and choose the starter kit called TxT.
Or you can find the code that is used for this on GitHub, https://github.com/umbraco/Starterkits/blob/master/Txt/Txt/Views/umbNewsOverview.cshtml, In Umbraco you will also find code snippets that you can use for this. e.g List Child Pages from CurrentPage.
Hope this helps,
/Dennis
Hi Dennis,
I'm copy-pasting the code in my project.
In what should I change the foreach loop?
@foreach (var feature in homePage.umbTextPages.Where("featuredPage"))
As it now only searches for the featured page of the other project and not mine.
The site I'm using is test.gregoir.be
Ok, little bit further.
But now it's only showing the titles of my (grid) project pages. http://test.gregoir.be/test/
@{ // Model.Content is the current page that we're on // AncestorsOrSelf is all of the ancestors this page has in the tree // (1) means: go up to level 1 and stop looking for more ancestors when you get there // First() gets the first ancestor found (the home page, on level 1)
}
Wonderful featured pages
@feature.Name
@* @Umbraco.Truncate(feature.BodyText, 100) *@Hi Laurens,
Do you have a structure where you have an overview page document type, and under this page you have each product page. Then you should be able to use this snippet of code.
With this code above you should get a list where it lists each product page name and a link to the product page.
Hope this helps,
/Dennis
Hi Dennis,
Yes, I have the following structure
templates -> master -> project page
partial views -> umbFeatures
Hi Laurens,
Okay, and you can get custom properies with
Where the propertyAlias is a field on the product page, it could be the descriptions of the product and so on.
Hope this helps,
/Dennis
Hi Dennis,
It's coming together now. Thanks for the help so far!
The truncate option is doing a few freaky things if you browse to test.gregoir.be/test
The code is:
Is it also possible to show the image left and the description right?
Hi Laurens,
Okay so you are using the grid layout. Then you need to create a row configuration that has an image on the left and the description on the right side.
I think this https://our.umbraco.org/documentation/using-umbraco/backoffice-overview/property-editors/built-in-property-editors-v7/Grid-Layout/configuring-the-grid-layout-datatype documenation can help you.
If you have access to Umbraco TV, there is also a whole chapter about how to work with the grid layout http://umbraco.tv/videos/umbraco-v7/implementor/fundamentals/grid-layouts/setting-up-the-datatype/. If not then you can find the different plans here: http://umbraco.tv/plans-signup/
Hope this helps,
/Dennis
Hi Dennis,
My grid is already configured as such and works as designed. Like you can see here: http://test.gregoir.be/projecten/project-a/
That's a grid page.
If I turn off truncate, then I get the whole gridpage, which I do not wish for. I have Umbraco TV. But this is something beyond the already provided information (I think).
As you can see (and understand) in the provided picture, I have no need for the searchbar and side navigation in the overview pane.
Hi Laurens,
There are some limitions when you are using the grid editor, you can read more about best practices here https://our.umbraco.org/Documentation/Using-Umbraco/Backoffice-Overview/Property-Editors/Built-in-Property-Editors-v7/Grid-Layout-Best-Practices.
One of the limitations is All content entered into the grid is stored as a single property value on the content node, as a big JSON object. This means that as soon as the values are stored in the database, there is no managed api to drill into the grid content and target specific cell content - so a grid layout is not a recommended storage of reusable content - it simply wasn't designed for this scenario. If you wish to reuse content in multiple pages, it is still recommended that you store these pieces of content as separate content nodes, so they can be stored, cached and queried as usual.
/Dennis
Thank Dennis,
I'll play around in my grid settings and throw out my sidenavigation from the grid and put it in the template itself. That will probably force my grid to only show project related stuff.
Cheers,
Laurens
is working on a reply...