Developer forum

Forum » CMS - Standard features » RE: News / Item URLs

RE: News / Item URLs

Victor Jonsson
Reply

Good day people!

I'm wondering which is the best way to display news on a DW site. It's important to get good URLs for each news item and be able to list them with e.g. date.

As far as i can see, there are 3 ways.

  1. Normal pages, subpages and listing them with XSLT
    This is really simple but the XSLT is missing extra information about the page. date etc.
     
  2. NewsV2 module
    This seems to be exactly what I need but the paths are in this format: /newsv2/nyhedstitel.aspx?Action=1&M=NewsV2&PID=4
    Despite checking the checkbox for custom urls here "Management center > Web & HTTP > User defined urls > Add-ins > News"
    (In danish: Nyheder - Nyheder (NewsId) - Genererer URLer for Nyheder i formatet: /News-name.aspx.)
    Perhaps i'm missing some configuration
     
  3. Item types / Item publisher
    Seems this could replace the NewsV2 module in the future :)
    But what about URLs for the item publisher? I get them in this format: /nyheder.aspx?itemId=Nyhed:1

Any tips on how to best accomplish this?

Btw, I'm running 8.3.0.4

Thanks in advance.

-Victor


Replies

 
Victor Jonsson
Reply

Update: On a live site running 8.2.1.11 (The above is a development site):

At least the name of the news item comes with the parameters like so: /Nyhederv2/name-of-newsv2-item.aspx?PID=6054&M=NewsV2&Action=1

I'd really like no parameters in the url.

 

 

 
Anders Ebdrup
Reply

Hi Victor,

 

I would go with the Items - you can see an example here: http://items.dynamicweb.dk/en-US/News

I think the items is much more flexible than the News-module as you can add more fields and better categorize the "news".

 

For the urls you can use: <!--@ItemPublisher:Item.Url-->, at least in the latest version of DW, and have nice looking urls.

 

Best regards, Anders

 
Mikkel Ricky
Reply
I second that: Items are the way to go. We're working on making items and the item publisher able to do exactly what the News module currently can do – plus a whole lot more.
 
The example that Anders mentions is on Github: https://github.com/dynamicweb/itembasedmodules
 
Best regards,
Mikkel

 
 
 

 

 
Victor Jonsson
Reply

Thanks for the tips guys.

 

(sorry for the late reply, I was on vacation)

 

 Looks like items is the way to go.

 

 But how do you make sure that the page that  points to, has a template that outputs @Item tags.

 

 I assume you're not using the Item publisher's details template (DetailsUrl)

 

 I'm using news as item pages and those two (DetailsUrl & Item.Url) do two different things.

 

 Like the news page example Anders posted, I'd like a main page that lists subpages (items) and uses pretty urls (Item.Url) to show them. I don't want to have to manually select an news-item layout for each new page.

 

 Where as if using DetailsUrl, it would use my selected template but use urls with ?itemId=Nyhed:1

 

 

Are you following me? I'm having a tough time communicating this.

 

 

Regards, Victor

 

 

 

 

 
Mikkel Ricky
Reply

Hi Victor,

You can create a page layout for your News items and set this layout as default Item page layout in the website layout settings. 

On our items example site, http://items.dynamicweb.dk/, we're doing this. See https://github.com/dynamicweb/itembasedmodules#usage for a short description on how to do it yourself (substitute News for Blog in the description).

Best regards,
Mikkel

 

 

 
Victor Jonsson
Reply

Hi Mikkel and thanks for your super fast reply! :)

(I've yet to try it) But this is probably, exactly what I was looking for!

Thanks again!

  

 

 
David Matheson
Reply
Just a point on using Items for news.  

When you create an Item it is automaticlly saved and will therefore appear immediatly in an ItemPublisher listing or as a published Item - that is to say before you have had the time to add the content.  The work around is to add (example) a checkbox to your item so that the item only appears on the web page when the checkbox = "True".

<!--@If(ItemPublisher:Item.Published="True"-->
**** ItemPublisher content goes here ****
<!--@EndIf-->

OR

<!--@If(Item.Published="True"-->
**** Item content goes here ****
<!--@EndIf-->

 

Cheers

// David

 

 Tested in 8.3.0.6

 
Victor Jonsson
Reply

Thanks for the tip David.

Regards, Victor

 

 
Victor Jonsson
Reply

One more thing though..

A rich text editor in an item does not use editor.css?

I've made an editor.css file so that when editing in backend, it looks the same as in frontend.

But that's doesn't seem to be used by the RTE in my news item. I hope it's possible or else it might confuse people working on the site.

 

UPDATE: The item editor uses /Files/stylesheet1.css which I changed to be have the same content as /Files/Templates/Designs/<template-name>/editor.css

 

Might not be an ideal solution for a multi-site configuration with different designs.

 

Regards, Victor

 

You must be logged in to post in the forum