Skip to content

chore: Add curated democontent - #75

Merged
fsbraun merged 2 commits into
django-cms:mainfrom
mrbazzan:democontent
Mar 4, 2026
Merged

chore: Add curated democontent#75
fsbraun merged 2 commits into
django-cms:mainfrom
mrbazzan:democontent

Conversation

@mrbazzan

@mrbazzan mrbazzan commented Sep 4, 2025

Copy link
Copy Markdown
Collaborator

JSON data from this page

@mrbazzan

mrbazzan commented Sep 4, 2025

Copy link
Copy Markdown
Collaborator Author

@fsbraun
On data import from blog.json, the Picture/Image plugin in the TextPlugin
does not render (It appears in the structure board but not in the actual plugin).

PS: The one that is encoded as <cms-plugin alt=\"Picture / Image - Image (274)\" title=\"Picture / Image - Image (274)\" id=\"274\"></cms-plugin>

@fsbraun

fsbraun commented Sep 4, 2025

Copy link
Copy Markdown
Member

@mrbazzan Interesting! Indeed, for text plugins the id of the child plugin also has to be changed within the text'S body field (i.e., the 274 be replaced by the actual pk of the child plugin everywhere inside <cms-plugin></cms-plugin>. Would that need to be done here or in djangocms-transfer?

Could be a task for regex.

@mrbazzan

mrbazzan commented Sep 4, 2025

Copy link
Copy Markdown
Collaborator Author

@fsbraun
That would mean finding the new pk; I'd like to think that's something djangocms-transfer should do?

Could this be done with the import and export processing setting in djangocms-transfer?

@fsbraun

fsbraun commented Sep 4, 2025

Copy link
Copy Markdown
Member

@mrbazzan Probably this needs to be done at the import - where it is already done for other pk references, e.g., plugin parents.

@mrbazzan

mrbazzan commented Sep 10, 2025

Copy link
Copy Markdown
Collaborator Author

where it is already done for other pk references, e.g., plugin parents.

@fsbraun On further search, I found djangocms-transfer require plugins that serialize references
to other plugin in its data needs to define a do_post_copy method that does the conversion.

TextPlugin already defines the do_post_copy method but it doesn't add the attribute hook, _has_do_post_copy which
allows djangocms-transfer to use the method. Instead of using the hook (which is undocumented I think), we could check if each plugin class has "do_post_copy" and call it?

@fsbraun

fsbraun commented Jan 21, 2026

Copy link
Copy Markdown
Member

@mrbazzan Can this be merged?

@mrbazzan

mrbazzan commented Mar 4, 2026

Copy link
Copy Markdown
Collaborator Author

Can this be merged?

@fsbraun Yes, it can. I just tested locally. The plugin gets created (and can be edited) now

@fsbraun
fsbraun merged commit ed9e40f into django-cms:main Mar 4, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants