Propagating a custom block to child pages - wordpress

So I have a custom block that displays a banner image on top of a parent page. I want the custom block to be automatically copied to all the child pages. Which means the child pages will also have the same banner image as the parent.
I have searched around the internet on how to do this but I have not found any solution. I only found plugins that allows me to display the child pages but that is not what I need.
Does anyone have experience in doing this? Or can anybody point me to the right direction to start with. I'm really feeling hopeless at the moment. Is this possible with gutenberg?

As far as I'm aware, there's no native way to accomplish this.
I normally create a template page with all of the blocks I expect to use and duplicate that as needed.
Depending on your implementation, I'd recommend looking at this page for block templates and see what applies. This article has more details on how to use block templates.

Related

Overriding existing (untagged) table styles using CSS?

So. I'm a CSS amateur, and I'm dealing with an issue a bit above my experience.
Basically: we have a site with a third-party vendor. We cannot modify their stylesheet. I've been told we cannot forward the URL. We cannot unpublish the without deleting it, which is not an option. We cannot upload our own stylesheet. We cannot edit the page HTML beyond a small window. And we need to disable the the site-- specifically, login functions-- so users can't use it, and provide them a link to the new site.
tldr; If this sounds backwards and convoluted, please understand I'm just doing my best to work with a third-party that doesn't really have a lot of flexibility.
So far, I've done this by identifying the styles they have, and writing my own css to disable them (just setting everything to height:0px width:0px overflow:hidden has worked pretty okay) and inputting that into the text/html field they let me edit. Which, honestly, seems kind of like a design flaw that I can break any page as badly as I'm doing, but what do I know...
Problem: they have a login form in a table. No div or class associated with it. With no class/id, I can't style it through css. Styling "table" to height:0px, width:0px just, uh, blanks the whole page.
So, my question: how do I style a table with no class/id in CSS alone with no ability to add a tag to it?
And yes. I know what I'm doing is probably giving everyone reading it an aneurysm. I'm sorry for my CSS crimes.
You can target the said form trough some parent which will work until they either reposition the table outside that parent or fuck with something you used to target the parent.
To be more specific I need a HTML structure of the said page.
But generally let's say you find a parent with a class Parent and this is the only form (otherwise you have to say nth child of type form) inside that parent you can use .Parent>form { your CSS code}
This should expand options for you. Ideally find a parent somewhere that has id and hope its unique for site.
NOTE: Be very afraid when you target things like this, if you can't bind that to either that specific page or specific unique-for-site id parent, you risk somewhere being the one or multiple other match for your CSS selector, and since in most cases (unless you use CSS loader or have separate indexes including separate CSS files) you share same CSS to entire web page it will change them as well.
NOTE: Be even more afraid if you use CSS outside of it's domain - STYLING especcialy for security things, like giving access. This is a serious security violation if you only hide login elements. Anyone with a bit of knowledge can read the code and hide it on client and login. At least don't load then into DOM using display:none; instead visibility: hidden;

Sulu.io CMS editor add images inside content

Is there a way to add images inside Sulu.io editor, rather than creating properties or blocks?
I have been searching this in their issues, documentation and google, but I'm not sure if its possible or not, even tho one can add image links but not image tag, does not make sense.
We don't plan to support putting images directly into the editor. We actually also don't want that, because it contradicts our philosophy. Enabling the user to do stuff like that in the editor, would probably also allow him to break the site in unexpected ways, and it's close to impossible to properly implement a responsive design this way.

Drupal 7: best way to render arbitrary content directly into <body> while keeping what's in <head>

I'm new to Drupal. As I understand a Drupal(7 in my case) page normally would have layers of wrappers around a block, sections, regions etc ... What I'm trying to achieve is to render some arbitrary content directly into "body" with none of the wrapper overheads, while keeping everything in "head". I've researched hook_block_list_alter which allows you to exclude blocks before rendering - which doesn't offer the ability to customize (removing) sections. Then I came across hook_page_alter looks like a good way to go, although I haven't dug too deep yet, still trying to understand the structure of the $page object. I thought about other options such as using the context module to configure sections/zones when requested page url is in certain pattern.
What's "THE Drupal's way" of doing this?
I would suggest you to first try with Drupal's template system and then, if you can't achieve something try with hooks:
https://www.drupal.org/node/337173
So, as you mentioned drupal has layer templates wrapping one around another. Most outer one is html.tpl.php and if you want something to appear in page head put it there. Then, second inner one is page template, which can be different for any content (node) type. But you also have block templates, field templates...
To override templates for specific content type or field or something else Drupal has some special naming convention. So if you name you template some specific way (and clear the cache!) drupal will start use it in that specific case.
Check the documentation for more details.

How to set dynamic markup to a transformation wrapper in Kentico

I'm very new to Kentico and asp, I'm coming from a php/Wordpress background into this. I'm working on a Page Template that has an optional Carousel in it. I'll need the content of the carousel which I have set as a Document Type, but I'd also like to be able to have a Settings Document type in which they are contained. In the Settings Document Type I want to be able to control what kind of wrapper goes around the whole thing, using a form to do this. I've played around with Hierarchical Transformations, but can't seem to get them to work. At best, I'm able to display markup from the transformation, but the variables set in the Settings Form won't to come through.
Does anyone have any idea as to the best way to get this to work the way I want it to, or is this even possible? I only have access to the CMS and have no access to the file structure or anything like that. I've looked through pages of Kentico documentation, but it seems vague and I can't seem to find any examples of anything close to what I want to achieve.
Update: I've finally somewhat figured out how to make this work with Hierarchical Transformations, but I'm still having an issue with the Opening and Closing Wrappers which I set as Header and Footer Transformations. For some reason these tags appear twice, one within the other. The outer one does exactly what it's supposed to do, but the inner one doesn't take the variables set within the form. Anyone have any idea how I can just display this once?

Drupal—Content Repetition & Consistency

I'm currently working on a Drupal site (I'm fairly new to Drupal) and need to be able to create some blocks of content that appear on multiple pages and remain consistent between those pages. I'll need it so that if I change the content in one place, the change will be reflected in all places it appears.
I've looked around in CCK a bit but can't seem to find a way to accomplish this there. Is there a way to accomplish this?
Thank you!
You can define your own blocks at /admin/build/block/add, just put your content inside a block and then go to "page specific visibility settings" and put the pages, on which the block should appear there.
There are other ways to achieve something like you describe, if the blocks don't do what you need you should provide some more details on what exactly you want to do. Depending on the structure of your site, you could also use a node (set to appear at the top of lists) that is set to appear on those pages.
It would depend of what kind of data you need to display in this block if its static use
/admin/build/block/add
if you intend to fetch some content from your content types use views to create such block and then use "page specific visibility settings".

Resources