Template bootstrap-3-9 is opposite to what it should be. Left is right and right is left.

Comments

inteja created an issue. See original summary.

gcharles’s picture

I also noticed this issue with multiple layouts.

darol100’s picture

Issue tags: +Novice

@gcharles, Feel free to open new issues if you found a bug on a template. I'm adding the Novice tag to see if someone wants to jump in a fix this minor bug.

inteja’s picture

Status: Active » Needs review
StatusFileSize
new6.85 KB

Here's a patch. Fixes 10 layouts left/right swapped or typos etc.

  • darol100 committed 4b13a7b on 8.x-3.x authored by inteja
    Issue #2669324 by inteja: Template bootstrap-3-9 is opposite to what it...
hs@henrikstrindberg.se’s picture

Layout templates 1-11 and 6-6 are also wrong.
Thanks

inteja’s picture

@hstrindb what's wrong with 1-11 and 6-6? They look OK to me.

darol100’s picture

I have created a new release 8.x-3.1, which contain @inteja fixes. For this reason, I'm closing this issue.

darol100’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

senpai’s picture

Status: Closed (fixed) » Needs work

The patch in comment #4 is a good start, but it doesn't fully address the "left-right-left, right?" game I'm still seeing as of v8.x-3.1.

To fully address this, all of the regions: declarations in bootstrap_layouts.layouts.yml need to occur as:

regions:
  sidebar_left:
    label: Sidebar Left
  sidebar_right:
    label: Sidebar Right

rather than the way some of them are now:

regions:
  sidebar_right:
    label: Sidebar Right
  sidebar_left:
    label: Sidebar Left

...since this order affects how the regions are presented in the Display Suite admin screens, especially when a layout is changed and the administrator is asked to re-map the content that existed in old region(s) to the new region(s).

In addition, as @hstrindb pointed out in comment #6, the patch did not seem to catch 100% of the lefty-righty reversed .twig templates.

trevorbradley’s picture

Version: 8.x-3.0 » 8.x-3.1

This is similar enough to the problem I just hit that I'm going to add my comments here instead of making a new report.

bootstrap-6-6.html.twig is literally backwards. Right is on the left, and left is on the right:

<div class="row">
  {% if content.sidebar_right %}
  <div class="col-sm-6">
    {{ content.sidebar_right }}
  </div>
  {% endif %}
  {% if content.sidebar_left %}
  <div class="col-sm-6">
    {{ content.sidebar_left }}
  </div>
  {% endif %}
</div>

It looks like 6-6 was missed in the patch.

Scanning through the rest of the templates... 1-11 also looks backward:

<div class="row">
  {% if content.sidebar_right %}
  <div class="col-sm-11">
    {{ content.sidebar_right }}
  </div>
  {% endif %}
  {% if content.sidebar_left %}
  <div class="col-sm-1">
    {{ content.sidebar_left }}
  </div>
  {% endif %}
</div>

EDIT: Just checked... this is fixed in dev.

inteja’s picture

The original issue was not with the order of columns in the markup (i.e. should 'left' be first or second in the markup?) but that in many templates the content of the column didn't match what was supposed to be in the column e.g.:

{% if content.sidebar_right %}
  <div class="col-sm-1">
  {{ content.sidebar_left }}
</div>

The order of columns within the markup is less important because bootstrap uses floats to pull the columns to the left or right IIRC.

trevorbradley’s picture

Yup, the original (closed) issue I should have found was https://www.drupal.org/node/2706247

There's no actual pulling in the bootstrap html in the two column template twig files, so dev is correct in switching the order, placing left "first" in the HTML.

However, @Senpai's comment #11 is still valid. "Sidebar Left" really should appear above Sidebar Right" in the Display suite. (If it were alphabetical, I might understand. :)

I have *really* bad luck with patches, but I've got to break that streak sometime. Here's the patch I believe @Senpai was looking for. It's working nicely for me.

trevorbradley’s picture

Version: 8.x-3.1 » 8.x-3.x-dev

(This patch applies against 8.x-3.x-dev, not 8.x-3.1)

trevorbradley’s picture

Status: Needs work » Needs review
markhalliwell’s picture

Status: Needs review » Reviewed & tested by the community

This issue shouldn't have been re-opened, but rather a new one created referencing this one.

That being said, the above patch in #14 is, in fact, needed.

Setting to RTBC.

darol100’s picture

Status: Reviewed & tested by the community » Needs work

This patch become out-date with due to #2815613: Uncaught PHP Exception InvalidDataTypeException: "yaml_parse()". Changing the status to Needs Work.

trevorbradley’s picture

Just checked, it looks like the changes in patch #14 already went through.

Apologies for polluting the issue queue... In the future I'll try to keep separate patches to separate (but possibly related) issues.

We now return to a discussion of patch #4...

markhalliwell’s picture

Status: Needs work » Closed (duplicate)
Related issues: +#2784265: Refactor module to be plugin based and allow template settings

This is being superseded by this related issue.