How to default center everything on a page with Nikola and reStructuredText - restructuredtext

I'm using Nikola to generate a static site, which uses reStructuredText for writing contents. For one of the pages, I'd like to change the default alignment to center for everything on that page. Is there a simple option that I can specify to achieve this?

Related

How to make sure region layout stays consistent over the website in Drupal

I've a weird issue in my Drupal 9 website where a couple of regions (subfeatures and footer) get rendered differently in different pages with no consistent behavior.
They are loaded via the theme's default page.html.twig and should render inside the page js-layout wrapper as in below screenshot
But in some pages, it gets rendered outside the wrapper like in the below screenshot
This is simple website with no overrides on the theme level for the regions so this is quite strange
Without knowing the theme, it is difficult to give an answer. (Which theme is used, which templates (which Twig file provides the theme) and so on...
But let me try to give you a starting point:
Check all twig files of your theme
If there is a multiple for page, like: page.html.twig & page--article.html.twig. Then check the HTML structure for it
Check the region's conditions
In the page-twig templates, check if the HTML closing tags depend on the region conditions. Is there a condition that the div sometimes closes earlier?
I hope this will help you.

Concrete5: How to display retina image through the image block?

I am trying to implement Retina.js plugin for displaying alternate images on retina display. This will certainly work if I have a fixed image path hardcoded into the page or theme but how do I make this work through the Image block? Or is there a better alternative to this?
That library sounds a little heavy handed in just pinging your server for every single image. However, if you include it in the page it should work just fine.
One thing to keep in mind is that by default concrete5 uses the <picture> tag to output from the image block. Any library you use should have compatibility with that tag.
If you end up using a library that requires you output the image differently, I'd recommend creating a custom \Concrete\Core\Html\Image subclass and binding it to the container in you /application/bootstrap/app.php file:
<?php
$app->bind('html/image', \My\Custom\Image::class);

Preserve original website formatting inside ckeditor?

I'm trying to do a simple wysiwyg editor and I am trying to edit this page.
I inserted that code into my editor and included the original css file from the website, yet it seems like ckeditor is putting its own tags around the overall content which breaks the original design. Is there a simple way to overcome this?
Thanks
Inline editing is what you want to do there. Simply render the website (component) in your admin panel, using your default, frontend styles and create inline editors for all editable fields. Finally serialize contents of editors.
CKEditor uses CSS from ckeditor/contents.css - you have to add your CSS there.
Your file is visible at http://makehugeprofit.com/editor/ckeditor/contents.css?t=E0LB and as you can see, it doesn't contain much. How did do "included the original css file from the website"? Merge it with contents.css and you'll have greater luck.
The editable area is an iframe and thus not in the same CSS space as your surrounding site.

Where should page hierarchies be rooted in Confluence?

I've recently started getting familiar with Atlassian Confluence (v. 3.3), but I'm having trouble understanding the best way to use page hierarchies within a space.
Within a space, pages can be located underneath the "Home" page, or one level higher, next to the home page. However, in the "Documentation" theme, the left sidebar page hierarchy is only shown for pages rooted below "Home". This means that the "Home" breadcrumb is always displayed when viewing pages that appear in the sidebar hierarchy.
So, what is the purpose of having pages on this top level? Should it be used specifically to hide pages from the sidebar hierarchy (like meta)?
Is it possible to have the sidebar hierarchy display for pages rooted next to Home (on this top level), instead of below it?
Is it possible to remove the Home breadcrumb?
How many of these questions are made irrelevant by later updates to the software?
The only real purpose I can think of for having a page on the same level as the home page would be to disclude it from a page-tree display starting at the home page. So if you have some pages you use for holding images, documents, testing content, et cetera then you would not want it to show up in the hierarchy viewed by regular users.
When you define a page-tree macro, or the children-display or anything similar, you can specify which page it is displaying the hierarchy from. If you want to use a page other than the home page, just specify it in the page-tree macro.
I don't believe it is possible to remove the breadcrumb, or at least I don't know how.
Software updates will maybe bring some other page-tree-esque options but won't fundamentally change anything else we're talking about here.
So, what is the purpose of having pages on this top level?
Specifically? You'd have to ask Atlassian.
Generally? The default configuration is that only pages from the specified Home page down are shown in the navbar.
Should it be used specifically to hide pages from the sidebar hierarchy (like meta)?
Yes. Any page which is used for navigation, control or configuration is stored at the top of the hierarchy. That way they don't show up in the navbar.
Using the {alias} macro will create a page in the top hierarchy.
If you use a page as input to your navbar then this page can be stored here out of user sight but still publically visible. So, if you had a page with lots of markup for a colourful and exciting navbar named SpaceNavigation then in the Documentation Theme Configuration you would have this code:
{include:SpaceNavigation|nopanel=true}
Is it possible to have the sidebar hierarchy display for pages rooted next to Home (on this top level), instead of below it?
Yes. Use the pagetree macro.
{pagetree:root=#none}
You can edit the space theme to show anything in the left navigation bar.
Browse > Space Admin > Theme > Configure theme
Untick the 'Page Tree' option at the top. Put your code to display content in the navbar in the navigation box.
If you want a pagetree somewhere in your custom navigation use the {pagetree} macro. You can set the root page to a page lower in the hierarchy. {pagetree:root=apple}
The {children} macro is also useful here.
The reporting macros can print a list of all pages in a space. You can build your own macro or import a wiki page to display as the navbar.
Is it possible to remove the Home breadcrumb?
This may need clarification. Are you looking to remove the breadcumbs or just the word 'home'.
Either way, the answer is 'JavaScript or CSS'.
If you are a space administrator you can add CSS styles to the space to disable CSS for the space from the header.
If you have the {html} macro or {style} then you can add styles and JavaScript to the wiki page.
If you are a wiki administrator, or have one on your side, then you can create a macro or plugin to put CSS or JavaScript code on the page.
Here is a code sample to find two classes on a page and after the page has loaded (document.ready) hide them.
{html}
<script type="text/javascript">
AJS.$(document).ready(function() {
AJS.$(".first").hide();
AJS.$(".second").hide();
});
</script>
{html}
This example will remove the word 'Dashboard' as it has the class of 'first'.
Go forth and write the code to find the objects that so draw your ire and vanquish them.
CSS is also an option and sometimes less messy.
Some CSS objects can be removed from the page from within the page. E.g:
{html}
<style type="text/css">
ol.breadcrumbs { visibility:none; !important; }
</style>
{html}
However, to remove objects at the top of the page you need to use javascript or put CSS in the space style sheet.
Browse > Space Admin > Stylesheet
How many of these questions are made irrelevant by later updates to the software?
It's pretty much the same. Some styles have changed. Some things have been moved around. The general look has changed.
Some of the style sheets have changed and they have said that they are looking to deprecate the Documentation Theme. However, given the community support for the Documentation Theme even if they remove it no doubt it will be available as a downloadable theme in V6.
If you are interested in looking at this yourself then you can download Confluence V5 with a trial licence or try their OnDemand free for one month.

Put Links at the End of a Page ( Drupal)

Is there a module in Drupal that allows me to put link at the end of a page?
http://lh6.ggpht.com/_SDci0Pf3tzU/Sfm7vF_MSiI/AAAAAAAAEtY/VX3BXaMOfSM/s400/linksatend.jpg
I tried to use menu and put it as a block at the footer, but the menu items are arranged vertically, instead of horizontally.
Is there anyway to do it without ( preferably) touching the CSS and HTML?
changing the menu items from vertically to horizontally is a matter of 1 or 2 css rules. which is why i doubt that there is a module for this. if you would post a link to your site, or the html + css, i could help with the css.
Links at the end of the page can be controlled by a few different things.
First, check the Blocks administration and see if there is a content area for the footer. Maybe there is a block there that is controlling these links.
Next, depending on well the theme is built, check the configuration options under Admin > Site Building > Themes > Conigure > (Your theme). Many have options to change what links display in the footer.
Lastly, check the page.tpl.php. They could also be hard-coded in the template (which is bad) and edited from there.
In terms of answering your question about 'a module to alter links', you can see that since the links can be controlled from different places, a module just for this purpose would be pointless. The correct way is to set the appropriate options in template.php so it can be configured in your theme settings.
You might have some luck using the Nice Menus module - it's intended to create animated menus but if you give it a flat menu tree, it might be close enough to what you want. If that doesn't work, there's about 100 modules dealing with navigation.
Still, the best way would be to place the menu's block in the footer and modify the theme to flatten it with CSS.
Assuming you don't won't to touch the theme, maybe because you're using an unmodified contrib theme, you can use either of two approaches:
create the block by hand as a custom HTML block, which gives you full control over the contents. The main downside is that you'll have to maintain it by hand instead of using admin/build/menus
create a PHP block, either custom (boo !) or in your site-specific module (better), to generate a block with markup appropriate for the theme you're using, based on the actual primary links, which you obtain from menu_primary_links(). Downside it that you have to create a site module if you don't already have one, or that you'll have to enable the PHP filter if you create it as a custom block.
This being said, I think you'd still be better off modifying the theme if it's a custom one, or creating a sub-theme for the theme you're using if it's a contributed one. It will be less work and, this being a matter of appearance, falls rather in theme scope than in module scope.

Resources