To do this you could create a specific document type called "news". When you create and name the document type there is i checkbox that asks if you want to create a template for the document type on creation. Make sure this checkbox is checked.
When you have setup the document type for news as you would like it to be, you can then go to the "Template" folder where you can see the news template has been created.
If you create some news nodes/items in the properties tab you can see that the "news" template has automatically been assigned for the node. So every time you create a news node it's been associated with the proper template.
The news should be created under a document type called "News items" for instance and have it's own template assigned. It is this template that you need to insert for instance a XSLT macro that lists all the news where the latest news is shown first.
The XSLT for this could for instance look like this
Please notice that the above requires that you name your document type for a news item "News" and that it has a property called "title", which would generate a link to the news item.
I hope this makes sense to you.
Otherwise I think you could maybe benefit from installing the Creative Website Starter package, which is ideal to study when you're starting out with Umbraco since many of the mentioned concepts above are in use in this package.
Have fun and please don't hesitate to ask if you're in doubt about anything.
template for news
Hello all
I want to make 1 templates which will show news written by me ....
If i add any new news then it should be shown along with old news ....
ie. new news should be shown 1st & then old news should be shown 2nd....
I am not understanding that how to make this thing as i am quite new to umbraco ...
So please help me in doing this .....
Hi Vaibhav
To do this you could create a specific document type called "news". When you create and name the document type there is i checkbox that asks if you want to create a template for the document type on creation. Make sure this checkbox is checked.
When you have setup the document type for news as you would like it to be, you can then go to the "Template" folder where you can see the news template has been created.
If you create some news nodes/items in the properties tab you can see that the "news" template has automatically been assigned for the node. So every time you create a news node it's been associated with the proper template.
The news should be created under a document type called "News items" for instance and have it's own template assigned. It is this template that you need to insert for instance a XSLT macro that lists all the news where the latest news is shown first.
The XSLT for this could for instance look like this
<ul>
<xsl:for-each select="$currentPage/News[@isDoc]">
<li><a href="{umbraco.library:NiceUrl(@id)}"><xsl:value-of select="title" /></a></li>
</xsl:for-each>
<ul>
Please notice that the above requires that you name your document type for a news item "News" and that it has a property called "title", which would generate a link to the news item.
I hope this makes sense to you.
Otherwise I think you could maybe benefit from installing the Creative Website Starter package, which is ideal to study when you're starting out with Umbraco since many of the mentioned concepts above are in use in this package.
Have fun and please don't hesitate to ask if you're in doubt about anything.
/Jan
Hi Jan
Could you please give any ideas on:
https://our.umbraco.org/forum/using-umbraco-and-getting-started/91704-umbraco-7-event-and-detail-page
is working on a reply...