This forum is for assistance with theme development.

Suggestions for an Aggregation Theme?

I'm building a service that aggregates and/or syndicates news. I'm open to theme recommendations. The features needed: compatibility with the Feeds module, the ability to search by location and/or topic, easy creation of either a full news story or a short brief. The theme would need to be clean and easily navigated by users.

I've done some checking and there a several directory themes that partially meet those requirements, but they are largely based on providing business overviews.

Arrangement of fields

In a form created by the cli, fields are displayed with the label above and the input below.
I need to display, in this manner, multiple fields horizontally
I have done various tests with flex

...['#prefix'] = '<div class="flex-container-row">' ;

but I did not succeed
The CSS is this
 

.flex-container-row {
  display: flex;
  flex-direction: row;
  margin-top:20px;
 }

Accessing the fields of another internal page from within preprocess_field

I'm working on a theme that has a field color_theme which is set by authors on pages. This allows them to group similar pages together within a certain color style - eg. background colors, pullquotes etc.

Within other pages I am using the fantastic paragraphs module to create a page builder of sorts, and one of the fields which is used a lot is a 'button' field, effectively a link.

Within preprocess_field I'd like to set a variable for the twig template based on the logic below:

Help me with editing css

I'm so frustrated with customizing the look of a Drupal theme I'm thinking of switching to another platform. The problem is seemingly simple: I want to change the styling of a starter theme. The problem is after entering the css to make the type size of an article body larger, no change is seen.  I've tried Stark, which I thought would be an extremely simple way to change the css, but that was not so. Any suggestions on how to find a theme with styling that can easily be changed?

Add class to twig expression

I would to do a simple thing in twig template but it appears to be more complicated than I thought.
So this is what I would to do:

    {% set corps_attribute = create_attribute() %}
    {% set corps_classes = [
    'col-md3 col-lg8 row-md3 row-lg5',
    'type-' ~ node.bundle|clean_class
    ]%}

but this doesn't work:   

    {{ content.body({corps_attributes.addClass(corps_classes)}) }}

and give this error:

How to conditionally display a block with twig

Hey Guys,

I installed the Twig Tweak module in order to display a block in my twig template.

I created a View with a contextual filter for Authored by on logged in User IDs.
If a user has ever inserted a review, then it will display the review for that user.

Intended result:

  • The if statement checks to see if the body of the block is empty.
  • If the body of the block is empty, jump to the else statement.
  • If the body has content then display the block

Actual Result:
The block is displayed with or without content.

Pages

Subscribe with RSS Subscribe to RSS - Theme development