Concrete5.7.5.2 How to Alias an html block with another html block in another page - concrete5

I have a site running in concrete5.7.5.2. All my pages's footer are uning an html block with the same content in it. When i want to edit something in the footer, i have to edit in all the pages's footer. Is there a way i can just update in one html block and it reflect to all other block that aliased to it?

You can make element for the footer so that you can use it any where. you have to edit it only one place and it will reflect every where you used this.
you can visit for alias
http://www.concrete5.org/community/forums/customizing_c5/display-page-alias/

You should use Global Areas for this. These are areas you can put into every template, view or single page. It will output the same content site wide.
$area = new GlobalArea('handle'); // instead of new Area('handle');
$area->display($c);
Everywhere you define a GlobalArea with the same handle it will output the same content. You can also edit it from every instance.

Related

Trying to change CSS on New-Post page (WP-admin)

I’m inside the New Post page on WP-Admin, where you can create a new post.
At the right column, there’s the category selector, in which you select the category for that new post.
I have something like 15 categories, and therefore the category box is showing with a scrolling bar. Since I need to automate some post creation, I need all the categories to be visible right away, without having to scroll.
So I found the css file that manages the height of the category box (it’s inside /wp-admin/css/edit.css and //wp-admin/css/edit-rtl.css) and there I changed the CSS files to allow a bigger height by default on that box.
However when I open the new post page, it still shows the small box in categories, and when I see the CSS rule, the change I made is not visible. It’s like the CSS is cached or something. I already made sure that my browser is not caching it.
The problem I think it’s because the CSS rules are not pulled directly from CSS files, but from this file:
http://www.website.com/wp-admin/load-styles.php?c=0&dir=ltr&load%5B%5D=dashicons,admin-bar,buttons,media-views,common,forms,admin-menu,dashboard,list-tables,edit,revisions,media,themes,about,nav-menu&load%5B%5D=s,widgets,site-icon,l10n,wp-auth-check&ver=4.7
That file seems to go and gather the CSS information from some place (which I assumed was the CSS files in the wp-admin/css/ folder, in which I could find the exact same CSS rules that were applied to the category box) but for some reason, it’s not retreiving the updated CSS file. Or something else is happening (Server side caching the PHP response and therefore retreiving all the time the old response?)
I wouldn't recommend tampering with core admin files, as any changes you make could be lost from a WordPress update.
The proper way to do it is through a custom function added to your theme or child-theme functions.php file:
add_action('admin_head', 'custom_admin_css');
function custom_admin_css() {
echo '<style>
/* remove scrollbar from categories panel */
.categorydiv div.tabs-panel { max-height: none !important; }
</style>';
}
Another options that will allow you to have CSS for individual pages is to use this OH header/footer plugin. Once you install the plugin you can then add your CSS in the header textarea of the pages admin. Just make sure you enclose your CSS within a <style></style> tag.

Custom template doesn't accept shortcodes

I've created a custom template by copying page.php and then removing basically everything except for the CSS link, so it looks like this:
The div on line 20 just puts a red box on the page so I can recognize that this template, and the linked CSS file, are handling the page. (The idea is to create a large blank page where I can put large tables. I don't want any header markup or sidebar markup, etc., to distract attention from the table.)
I see the red box fine, but when I try to insert a shortcode on the page, to insert a table from TablePress, the shortcode isn't processed. I assume I removed something from page.php that is needed to process shortcodes, since a normal new page, that uses page.php, processes the shortcode fine. Does anyone know what I might have removed that killed the shortcodes?
Thanks.
Two thoughts about your code / problem:
1) I think you should not insert the stylesheet link like this. See: https://codex.wordpress.org/Function_Reference/wp_register_style
2) You can insert the shortcode with
<?php
echo do_shortcode('[ShortcodeName]');
?>

Placing block inside a node (positioning block between specific elements in node's content)

Basically I created a webform and enabled it as a block, now I want to put that block inside a specific node. I can do that by placing it in a 'content' region and defining the specific node BUT it displays at the end of the content. Now how can I move it between specific elements inside the content?
The node is using a page-type....tpl.php which is used by 5 other nodes as well so I cannot change the code.
To visualize it looks like:
[ content ]
-description text-
-list of videos-
[ end of content ]
and I need to put my webform between the text and the video list. Is there a way?
There are many roads you could take, but since you said you're considering the template file: Why not use a node-specific template, since page is a node type?
Say you're on node/123, then you could use a template named node--123.tpl.php
(see Drupal 7 Template (Theme Hook) Suggestions) and embed your block right there.
Alternatively, you could provide a reusable token in a custom module via hook_token_info and combine it with the commonly used token_filter module. But that might be over the top, if it's just one node you need to touch.
For Drupal 7 a bit of a hacky way to display the contents of a block in content would be to enable the PHP Filter module. Then edit your node and switch to the PHP code Text format and add this code
<?php
$block = module_invoke('block', 'block_view', '1');
print render($block['content']);
?>
where '1' is the block id found in the URL when you edit the block and be sure to include the PHP tags.
Also see this page https://www.drupal.org/node/26502 for more information on placing blocks.
You can use the EVA module to add the webforms in the node as a field.
You basically create a view and choose the "eva field" option then you make sure that this view selects only the webforms you want to have and relates it to the node (the EVA module documentation has much better examples than I can provide).
After you have added it as a field you can place it anywhere in the node.
There is also the Block reference module that could help you.

wordpress. error creating content for custom templates with twentytwelve theme

i'm using the twentytwelve theme and i have to write custom content into my example template.
I want to maintain my header content so the main structure is the following
header = id page, wrapper
ex.page = primary, content
footer = close wrapper, close id page
If i have understood correctly, if i want to insert content into the middle of my page i have to do it into my template page (that is a copy of the main page.php), that is in the middle between my header and my footer
For example i want to insert a div into which insert the loop of such category.
The problem is that it displays me nothing, like i've wrote nothing. I can only see the contents if i erase all the originary div, but it's not what i want to do, just because the only div is the page which is my container.
I can't catch what i have to do.
Can you tell me what i forgot to do?
Thanks,
Alex
page.php is a "master" document. header.php, footer.php and (if it exists) sidebar.php are all imported into page.php. Twenty Twelve also uses atomized content templates. You may need to add your div to content-page.php, which is also imported into page.php. content-page.php is used inside the wordpress loop, and encapsulates the code that pulls in the actual article elements from the wordpress database.
If you are trying to add straight HTML to the templates, ensure that you are not adding code between the php brackets:
<?php // don't add html here ?>
<div>do add html here</div>
Depending upon the type of wordpress page you are trying to display, you may need to consult the Wordpress Template hierarchy to determine the proper Wordpress naming convention for your template file (the copy of page.php).
Technically speaking, everything in content-page.php can be put into page.php replacing the get_template_part function. All the 'content' pages are totally not required and can be combined into one file if you want simplicity.
In my opinion, it's easier to start from scratch when learning Wordpress rather than try and re-work something. The default wordpress themes don't lend themselves to be beginner friendly.

Drupal , how to render block in 'content' of a node?

I have a common content in few pages. And I want include the content in 'content' of a node.
What I thought is use block, but I don't know how to use block in 'content' of a node. There is still some other different "div" wrapping the block, and I can't write the block in template file.
What should I do? Thanks!
I would avoid rendering a block directly within the content of a page.
Instead make a new region directly above or below the content (depending on where you want your block to appear) and then put then block in the new region.
It is also possible to render your block directly in the template file using
$block = module_invoke('modulename', 'block_view', 'block_name');
print render($block);
This post discusses the merits of both methods: http://drupal.org/node/345361

Resources