Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeUsing DNN Platf...Using DNN Platf...Skins, Themes, ...Skins, Themes, ...Need input on updating ContentItems tableNeed input on updating ContentItems table
Previous
 
Next
New Post
6/25/2015 10:01 PM
 

I'm creating a template from a portal where we backed up pages (tabs) as Store - Copy (for Store, for instance), My Account as My Account - Copy, etc.

These tabs are now deleted.  Also removed from the Recycle Bin.

But ... when a template is created, the content tag in the template shows Store - Copy when the page on the portal being copied is Store.

The Content Items Table and related tables need to be re-synchronized basically.  The content on Portal 0 should be the only content to copy.

All child portals except one have been removed.  We're using Catalook, which has a resources table (sort of like a cache) and this has been cleared out. (Truncated) But even now when making a template, the Store - Copy (and other pages with - Copy) are referenced.

Exactly how is this table re-synchronized such that the content being used is for portal 0?  Am I asking the question clearly?

Thanks,

Mike

 
New Post
6/26/2015 10:04 AM
Accepted Answer 

you may run the following statement in Host > SQL to update title for content items:

MERGE INTO {databaseOwner}[{objectQualifier}ContentItems_MetaData] M
USING (SELECT C.ContentItemID, TabName
	   FROM {databaseOwner}[{objectQualifier}ContentItems]         C
       JOIN {databaseOwner}[{objectQualifier}Tabs] T ON C.ContentItemID = T.ContentItemID)
	    S ON (S.ContentItemID = M.ContentItemID AND M.MetaDataID = 1)
WHEN Matched and IsNull(M.MetaDataValue,'') != S.TabName THEN UPDATE SET MetaDataValue = S.TabName
WHEN NOT Matched THEN INSERT 
	   (  ContentItemID, MetaDataID, MetaDataValue)
VALUES (S.ContentItemID, 1, TabName);

Cheers from Germany,
Sebastian Leupold (Microsoft MVP)

dnnWerk - The DotNetNuke Experts   German Spoken DotNetNuke User Group

Speed up your DNN Websites with TurboDNN
 
New Post
6/28/2015 1:45 AM
 

Thanks, Sebastian.

This is a bit of very advanced SQL -- for me anyhow.  Never have used this myself but I understand basically what it's doing.  I was going to try something like this to fix the issue using SQL I did understand (and would have  ended up being MUCH more involved...) but this should nail it.

 
New Post
6/28/2015 2:12 AM
 

Could not edit my prior post for some reason:

Just to be sure ... when I ran this query prior to making my post:

 SELECT T.PortalID, CI.Content
FROM dbo.ContentItems  CI
    JOIN dbo.Tabs T
        ON T.TabId = CI.TabId
WHERE Content LIKE '%copy%'

I got this result set:

PortalID    Content
0    Store - Copy
0    My Account - Copy
0    My Business Profile - Copy
0    My Store - Copy
0    My Products - Copy
0    My Related Products - Copy
0    My Sales - Copy
0    My Referral Sales - Copy
0    Cart - Copy
0    My Wish List - Copy
0    My Orders - Copy
0    My Recurring Subscriptions - Copy
0    My Business Profile - Copy
0    HelpDesk - Copy
0    Feedback - Copy
0    My Loyalty Points - Copy
0    My Referral Sales - Copy

 It was obvious metadata, etc. was not right. I did save one child portal that has some work I need in it -- PortalID 1103.  It sounds like I only want Portal 0 itself to exist before I run your query, just to be certain metadata updates ONLY as intended.  Would this be correct?

Thanks,

Mike

 

 
New Post
6/28/2015 8:20 AM
 

Sebastian,

I just needed to find a good link that explains MERGE to enhance my grasp of it and then look at your query again.  For the benefit of others, here's the query with portal 1103 used on the first INNER JOIN.  *NOT* to be used on the production case, of course but to illustrate what's going on.  The page (tab) names are right and when looking at portal 0 those tab names are also right.

My query looked at the incorrect content names based on a JOIN with TabId values.  The other way below shows the correct Tab Names that will be used to update / Insert into the the Metadata table by getting the right names from the Tabs table.

This answers my own question.  Just had to dig a bit into how the correct query works and hopefully this benefits others.

Thanks!

MERGE INTO dbo.[ContentItems_MetaData] M

USING (
    SELECT
        C.ContentItemID
        , T.TabName
        , T.PORTALID
    FROM dbo.[ContentItems] C
       JOIN dbo.[Tabs] T ON C.ContentItemID = T.ContentItemID
       AND T.PORTALID = 1103 (and also use 0 so one can see what's happening with this JOIN)
       )
        S ON (S.ContentItemID = M.ContentItemID AND M.MetaDataID = 1)
WHEN MATCHED AND IsNull(M.MetaDataValue,'') != S.TabName THEN UPDATE SET MetaDataValue = S.TabName
WHEN NOT MATCHED THEN INSERT
       (  ContentItemID, MetaDataID, MetaDataValue)
VALUES (S.ContentItemID, 1, TabName);

 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Skins, Themes, ...Skins, Themes, ...Need input on updating ContentItems tableNeed input on updating ContentItems table


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.

Content Layout

Subscribe to DNN Digest

Subscribe to DNN Digest

DNN Digest is our monthly email newsletter. It highlights news and content from around the DNN ecosystem, such as new modules and themes, messages from leadership, blog posts and notable tweets. Keep your finger on the pulse of the ecosystem by subscribing.  


Copyright 2017 by DNN Corp Terms of Use Privacy
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out