I'm trying to update TinyMCE content(i.e a CSS class) from a set of pages with multiple language versions.
Below are the challenges I'm seeing to access the TinyMCE.
The TinyMCE is located in the below path structure,
Page with multiple page version -> Block -> Block -> Block with TinyMCE.
Since the site has multiple languages the above Blocks and pages are published in different languages, we have to update all those block versions.
As Input, I have a list of page links.
I thought about creating a scheduled job, but it looks time-consuming, So like to create an SQL script if possible.
Can anyone suggest me a solution?
Take a look at the table [tblWorkContentProperty]. You'll find TinyMce stores it's markup in the 'LongString' column. You can change it here.
You can work out which content property that value belongs too by plugging fkPropertyDefintionId into [tblPropertyDefinition]
You can also gain further information by querying [tblContentType] and [tblWorkContent] to understand on which page the content property resides.
Even though I love SQL just as much (probably more?) than the next guy, I think this use case is one of the few where you are better off actually writing an admin tool to do the job.You'll probably only running this job once, right? A scheduled job will "pollute" your SQL tables tblScheduledItem and tblScheduledItemLog for no good use. Scheduled jobs are for stuff you're scheduling, i.e. running multiple times at a set interval. I guess not everyone will not agree with me on this, and those rows in the database does probably not matter, or you could always delete them later. Anyway, I think it's nice to be aware of them.
If you want to go the SQL route, and only care about published blocks (not old versions or drafts), I don't think you'll need to dig into tblWorkContent. Just run query like this, if the class you are querieing for isn't used elsewhere.
SELECT * FROM tblContent c, tblContentProperty cp
WHERE c.pkId = cp.fkContentID AND LongString LIKE '%class="deprecated"%'
If you do this in code, just do something like this. It shouldn't take long.
Thank you Surjit and Tomas, Above your input helped me to fetch the Content.