I am using the following code to query news items:
var allNews = Dynamicweb.NewsV2.NewsItem.GetAllNewsValidAndActiveAndNotArchive();
This returns a collection of NewItem instances. But how do I access the meta data of the news item?
Imar
This returns a collection of NewItem instances. But how do I access the meta data of the news item?
Imar
Hmmm, this smells like a N+1 problem, where I have 89 database calls for 88 news items, no?
I am creating my own News Url provider because the existing one seems broken and I would like to use the news meta title as the URL. Is this this the right approach to implement this?
Imar
And it is not broken.
Ah, that's good news. But does that mean that <!--@News:Href--> is broken then? I don't build up the URL myself, but retrieve it from this tag....
And to make things more confusing: even when I build up my own link it doesn't seem to work:
<a href="Default.aspx?ID=<!--@Global:Page.ID-->&NewsId=<=!--@News:ID-->">....</a>
I also can't seem to access the PID tag here, so it looks like I *have* to use News:Href.
The news module also have a field for the URL
Do I have to do something for this field to show up? Can't find it when editing a news item.....
In the mean time, did you find the URL field on the news item? Or is that DW 8?
Imar
I updated the site last night to the latest version of DW. You can find it here: http://test.nl.sapph.mediaweb.nl/ and the news page here: http://test.nl.sapph.mediaweb.nl/nieuws.aspx (which is a redirect from /Content/Nieuws in the backend).
The current SEO URLs are created with a custom URL Provider. Still needs some work as I need to strip odd characters from the URL. I just couldn't make it work with the default URL Provider and standards tags, but obviously I would like to....
Imar
You must be logged in to post in the forum