Change text size of table in Asciidoc - asciidoc

How to change the font size of a specific table in Asciidoc (PDF)?
I already tried a custom role:
role:
small:
font-size: 10
Table:
[.small]
[options="header"]
|===
|Vielfachheit |Feldname |Beschreibung |XML-Tag
|1 |Einzelsicht | |view (Tag)
|===
But it didn't change anything.
EDIT:
Looks like this isn't possible according to a similar question: Is there any way to change the text size (font size) of specific blocks when you using asciidoc?

Your solution does work when converting to html but not when converting to pdf. It is currently not possible to set a custom roles to a table with with PDF styling, see https://docs.asciidoctor.org/pdf-converter/latest/theme/custom-role/
Custom roles only apply to paragraphs and inline phrases.
The solution you have is to set the role directly to the text:
[options="header"]
|===
|[.small]#Vielfachheit# |Feldname |Beschreibung |XML-Tag
|1 |[.small]#Einzelsicht# | |view (Tag)
|===
Obvisouly the readability is not good but it does work and you do that for only a few cells this might be ok.
Note: I do not know why you want to change the font size for one single table but if you want to highlight it differently than the rest you could also put it inside an example block or a sidebar

Related

Change content heading text color in homepage

I am starting up with Magento.
Trying to change color of content heading to red.
I have updated cms_page table like below using HTML tags:
It is being shown on page like below:
Color is not changed.Text is being shown as it is, with tags.
How can I set color for content heading?
Well, the tag isn't good.
If you want to style inline you should use something like:
<p style="color:red">New Content Heading</p>
Although i would strongly recommend to style via less files
Hope this helps you!

How to create a Joomla Subtitle using "|" Vertical Bar?

I have seen some templates in Joomla that allow you to create a subtitle for an article just by entering the text into a single title text field such as this...
The Article Title | And My Subtitle
It doesn't seem to be a custom field - it appears more like it might be a shortcode. Has anybody come across this before and know where I can find the code for this or where in such templates I should look?
You would do this in a template override. Anywhere the title field might display, you would want to do something like this in the code before the title display part -
<?php
$titleparts = explode("|",$this->item->title);
$this->item->title = $titleparts[0];
$subtitle = $titleparts[1];
?>
You would probably want to put in a conditional statement looking for the | in the title before processing it, but you get the idea.
WARNING - I didn't test this code but it should work.

Auto add image to node listing from node body field | DRUPAL

Hi I have news content type, where are fields Title(textbox), Body(text with CKeditor) and Summary Image(multimedia asset). Is it possible to automatically add first image from Body to summary image field on form save?
Probably not or at least not so easy. You will need a custom parser here and a preproccess function.
Why not using an extra img field that will display only on the teaser display (I say Teaser instead of Summary since it is used more in Drupal like this) or just use the first image of the Summary Image (multimedia asset) field using image_delta_formatter module?

DataTables - Adding filtering function to a column

I have a table which have information which I would like to exclude from the search box. For example, in one of the columns I have some text and then links, it looks like that:
<td>
<div>John Doe</div>
<div>
View |
Edit |
Delete
</div>
</td>
Of-course in this case I would like the search box to consider only "John Doe" as a text to be searched.
I draw my table in php (I use Symfony-2) and apply the DataTable plugin using dataTable function with jQuery. I got the impression that what I want is possible, but couldn't manage to achieve it. Other discussions like http://www.datatables.net/forums/discussion/255/customising-the-way-the-filter-works/p1 neither helped me to solve this problem.
Thanks!
I'm sure there are ways to customize the actual search function (you could specify the type for the column using mDataProp and then write a custom filter for that type maybe?).
But a different way to go about it is to have your PHP script only supply the name: John Doe. This will be the original data for the cell.
Then in your column definitions, use fnRender() to format the cell using the layout you use in your question -- and have it automatically parse the name to create the links you want (assuming all names are first and last, and all links just use the combined first/last names, this should be fairly easy to implement).
Then set bUseRendered to false for that column and it will perform all of its sorting and filtering based on the original content, not the new content. See more here.

Resizing/Scaling images in a view by setting custom CSS width

Problem
I'm doing some maintenance and changes on a Drupal site, but I'm not an expert. My problem is the following. I have a view that produces an HTML table by fetching some field values and putting them into the table columns. One of these field is an image. Unfortunately each image has a different size (images are uploaded by users), and so the overall table looks ugly. I would like to resize/scale images so that they all have the same width. I know I can use CSS to set the image width to a fixed value, and let the height adjust accordingly:
<img src="..." style="width:70px"/>
Unfortunately I don't know how to make Drupal output this custom HTML when processing my view. Currently the produced HTML looks like this:
<img
class="imagefield imagefield-field_imgsmall"
width="100"
height="39"
alt=""
src="http://www.mysite.org/sites/default/files/foobar.png?1292948397">
and I guess this is produced by one of the view's fields (namely field_imgsmall).
First question is: what is that number after the ? in the src URL? And where does it come from? (Each image has a different number in the corresponding src URL)
What I've tried
I've noticed that in the "edit view" mode, when selecting a field, I can check the option Rewrite the output of this field, and there I can mix HTML and substitution patterns. However, I've seen that one of the substitution patterns that's available to me ([field_imgsmall_fid]) is actually producing the entire HTML above ... so I can't customize it.
What can I do? Am I going in a totally wrong direction?
You should look into the imagecache module, which allows you to resize images (and cache the results, so the resizing process rarely happens).
Here's a walkthrough:
http://2bits.com/articles/drupal-using-imagecache-with-views-and-cck-imagefields.html

Resources