Override existing block

Get helpful answers from community members using Rubedo 3.x

Override existing block

Postby cocqueel » Thu Apr 20, 2017 9:32 pm

Hello,
I would like to override the contentDetail block, to be able to customize de way our products are displayed on front.
In your developper guide (https://docs.rubedo-project.org/fr/docu ... oper-guide) you mention that in the extension test in github, there is an exemple of how to override an existing block (menu), but I can't find it anywhere (just in CSS, but that is not overriding the functionalities).
Could you tell me how to do so ? We have an extension running well for new blocks, but I can't find anywhere how to override existing blocks.
Thank you,
Emmanuelle
cocqueel
Member
 
Posts: 12
Joined: Wed Feb 08, 2017 3:43 pm

Re: Override existing block

Postby nicolas.rhone » Fri Apr 21, 2017 9:37 am

Hello,

In your extension, if you just add your templates in the templates directory (with the same name that the original templates - for example here templates/blocks/navigation.html ). You have to follow the same directory structure that here : https://github.com/WebTales/rubedo-frontoffice/

Same thing for the controllers : for example here src/modules/rubedoBlocks/controllers/MenuController.js
nicolas.rhone
Member
 
Posts: 81
Joined: Tue Sep 16, 2014 3:24 pm
Location: Lyon

Re: Override existing block

Postby cocqueel » Fri Apr 21, 2017 1:14 pm

Ok great, but how can I override my contentDetai only for one type of content ? I mean, we have different type of contents, and we need to have different layouts for each and every one of them.
Thank you !
Emmanuelle
cocqueel
Member
 
Posts: 12
Joined: Wed Feb 08, 2017 3:43 pm

Re: Override existing block

Postby nicolas.rhone » Fri Apr 21, 2017 3:06 pm

In Rubedo, in Content Types, in the properties tab, you have a "Code" . If for the News content type you put in Code : news_template (for an example) if will look for the file templates/blocks/contentDetail/news_template.html

YOu can also directly ad your template in the Layout tab : https://docs.rubedo-project.org/en/home ... ser-layout
nicolas.rhone
Member
 
Posts: 81
Joined: Tue Sep 16, 2014 3:24 pm
Location: Lyon


Return to Rubedo V3 : Q&A

Who is online

Users browsing this forum: Google [Bot] and 2 guests

cron