List style article in drupal 7 - drupal-7

I'm trying to create a content type that allows me to post multiple images from an external database in this sort of style: http://www.newageman.co.uk/14-time-travelling-celebrities
In an ideal world this is what I would like my group of fields to look like in the article creation screen.
http://oi57.tinypic.com/wi0z8i.jpg
Any idea how I would achieve this using best practices? To post articles like this I'm currently using a piece of php code but it's confusing for my contributors, so would like to use fields. I've never made a module or custom field before.
Thank you!

I have done something similar using the Field Group module, you may give it a try.

Related

Wagtail - how to put two fields in one row in admin form?

I would like to put two fields next to each other. I didn't find any instructions in the wagtail documentation so I think it's more tricky or not possible in the current wagtail solution. I suppose that the only way to achieve it is the override edit form the HTML file, right?
I would like to have something like this:
You probably need the FieldRowPanel. Reference: https://docs.wagtail.io/en/latest/reference/pages/panels.html#fieldrowpanel

DMN Decision Table Output

I am new to decision table so please forgive me if I asked a very basic question. I am working on an angular web app that uses decision table.
Could we change the table header 'Output' to something else?
Unfortunately, I cannot find any such label neither in the HTML nor in the controller.
For future reference:
It cannot be done through CSS. therefore following is my solution.
Inspect the code that either the dmn table is using modeling module or some other bpmn table features. In my case, it is using modeling. I override the following module by inheriting from it, to make the Input header cell dynamic and output fixed or change the label as well.
https://github.com/bpmn-io/dmn-js/blob/31803afe1bdccdc350da73293a75e2cbf3f14932/lib/table/features/modeling/Modeling.js

Finding an solution on Views?

Hi everyone I am developing an website and I wanna use one block similarly to this link https://careers.mit.edu/#block-views-facts-block.
Which it contains the flowing text and i liked it by the way so i wanna do it similar to this.
Would be grateful if any one suggest me the right way to do it.
they are using Drupal Views to output a text blocks, after custom animate function in JS/JQuery
check this file
https://careers.mit.edu/sites/default/files/js_injector/js_injector_2.js
Drupal.Careers.scrolling_text_animate
and few more to handle text position ...
animate function is quite big, you can do similar or look for an JQ plugin

Drupal: How is this component named?

I would like to create a table that looks/behaves like the one to manage fields when editing content types.
How is this one named? Is this form API?
If you're looking for the drag and drop sorting behavior, then you should look at the documentation for drupal_add_tabledrag.
And perhaps this tutorial might help: http://aswapathy.com/d78tu/tabledrag/theme_the_form_doc
I would implement it using Forms API together with a table.
If you are new to forms API, this step by step introduction is really good:
http://drupal.org/node/262422

How to add a custom field into template.php using Zen sub theme

First time poster here, I'm a designer not skilled at all with php and I have a small issue I don't seem to be able to solve. I'm making a site in drupal 7 using a sub theme on zen.
Btw this is a great CMS, even though people say it's really more a developers CMS. I have no trouble to do what I need using views, rules, display suite etc. So a big thank you for all the developers out there making this such a good CMS. But for this apparently simple problem... no module will help me (I think) and I'm kinda stuck.
So here it is: I'd like to add a subtitle next to the title in all my pages.
So what I did was to add a custom field into the content type basic page (machine name: field_sub_title) which is a simple text field.
I uncommented the following line in my template.php
function mytheme_preprocess_page(&$variables, $hook) {
$variables['sub_title'] = t('field_sub_title');
}
Now my question is how do I load the content of my custom field into that variable?
I know i need to change the second part, but I don't have a clue as into what I need to change this.
Displaying the variable into the the page.tpl.php is something I know about so I only need help with the first part.
{EDIT}
Ok I found how to do this :)
I was looking for a solution in the wrong place. I don't need to change any thing in the template.php file.
Just needed to add this bit of code into my page.tpl.php:
<?php
print $node->field_sub_title['und'][0]['value'];
?>
So I'm posting this here for other Drupal newbies struggling with this....
Your solution may work for now, but there may be a more Drupal-y way to handle a problem like this. If you haven't noticed any problems yet, you may find one or more of the following issues down the road:
Someone who doesn't know php or Drupal theming may need to change the way this works.
If you're like me, you may forget where exactly in code this was implemented.
You may see superfluous markup and/or errors on nodes (content) that do not have this sub-title field (ie. event content not having a sub-title field while basic pages and news articles do).
When you add a field to a content type, it will automatically appear anytime content in that content type is displayed. You should be able to add the sub-title field for your page, event or whatever else you need and have it automatically appear in the markup.
You can 'manage display' of a content type to drag and drop the order for fields to appear. You could take it a step further by using a module like Display Suite to add formatting or layout per-content type.
If you feel like this isn't good enough and the markup for the subtitle must be at the same level as the page title (which is rare), at least add an if statement to make your code check to see if the variable is present before trying to print it. I'd also add a new variable and comments for code readability.
<?php
$subtitle = $node->field_sub_title['und'][0]['value'];
if($subtitle){
print $subtitle;
}
?>
Consider using field_get_items or field_view_value, or at least use the LANGUAGE_NONE constant instead of 'und'
See https://api.drupal.org/api/drupal/modules%21field%21field.module/function/field_get_items/7 and https://api.drupal.org/api/drupal/modules!field!field.module/function/field_view_value/7
This has the added benefit of reducing the number of potential security holes you create.

Resources