Webpages/Links and CatalogNodes
Webpages/Links and CatalogNodes
In the database, how to Webpages relate to their particular CatalogNode? I don't see the data anywhere. I need to run a custom query on Webpages within a particular category, for some custom fields that I've added. Same for Links.
Re: Webpages/Links and CatalogNodes
They are in the ac_CatalogNodes table. CatalogNodeTypeId = 2 for webpages. (0 = category, 1 = product, 3 = link).
Re: Webpages/Links and CatalogNodes
I understand that, but my question is how do I know which specific Webpage correlates to a given ac_CatalogNodes record (assuming, of course, that the CatalogNodeTypeId = 2)?
Re: Webpages/Links and CatalogNodes
So you want to get all the webpages for a specific category?
Here's a SQL Query that will return the webpage data. You can add a WHERE clause for the appropriate CategoryID
You can also use the CatalogNodeDataSource.LoadForCategory to return all the nodes and loop through that collection looking for the nodes that are of type webpage.
Here's a SQL Query that will return the webpage data. You can add a WHERE clause for the appropriate CategoryID
Code: Select all
select cn.CategoryId, wp.*
from ac_CatalogNodes cn
join ac_Webpages wp on cn.CatalogNodeId = wp.WebpageId
where cn.CatalogNodeTypeId = 2
Re: Webpages/Links and CatalogNodes
Ah, my bad; I misunderstood the table's keys. I thought CatalogNodeId was the primary key by itself, not a (sort of) foreign key.
Re: Webpages/Links and CatalogNodes
This is one of the few places where the ID isn't a unique key. It's a nice structure for mixing the category structure with the content (webpage, product, link). When you're just looking for products or webpages or links in a category it's a little weird.