Hi Pukku,

Would you accept a patch to support a width parameter. Quite often I use the collapsed text to show some code which has very wide lines. To palliate to that problem, I like to force the width. The system automatically adds an horizontal scrollbar and that way the width of the page doesn't get affected.

So... something like [collapsed width=450px] should be used to force the width of the collapsed contents. It is particularly easy to make it work, and I'll be more than happy to provide the necessary code.

Thank you.
Alexis

CommentFileSizeAuthor
#3 collapse_text-6.x-fix_quotes.patch475 bytesAlexisWilke

Comments

pukku’s picture

Hi! I would actually suggest that instead of this, it would be better to use the class= parameter.

In your CSS file, create a class:

fieldset.large-code-block {
    width: 450px;
}

And then use the collapse tag as:

[collapse class="large-code-block"]
...
[/collapse]

(Note that I haven't tested this, so you may need to change the css a little bit.)

Ricky

AlexisWilke’s picture

Status: Needs review » Active

Hmmm... Well... that means I'd need such a class for each theme I have and since I run many websites.

But I agree that is a neat solution too. Let me check to see whether I can make it work.

Thank you for the fast response! 8-)
Alexis

AlexisWilke’s picture

Status: Active » Needs review
StatusFileSize
new475 bytes

Ricky,

Okay, the class="name" does not work with FCKeditor.

The quotes (") are transformed in ". There are two ways to fix this:

1) accept the class without quotes (I tried that doesn't work)

2) accept the " by transforming it back to " (any entry with " at the extremities must be a " that was transformed by a WYSIWYG editor anyway.)

I think (2) is best and there is a fix for all entries to get the proper quotes at once:

  // fix quotes
  $tag = preg_replace(
    '/( [a-zA-Z]+=)"(.*?)"/',
    '\1"\2"',
    $tag
  );

See patch also. 8-)

Also, setting the width of the fieldset doesn't work. You have to force the width of the div below instead:

fieldset.code-block div.fieldset-wrapper {
	width: 550px;
	background-color: #f0f0f0;
}

Thank you.
Alexis Wilke

update: added working CSS code.

working sample: http://linux.m2osw.com/bind_errors

pukku’s picture

Assigned: Unassigned » pukku
Status: Active » Needs work

The problem with forcing all `"` to change into quotes is that if a quote is desired in the title, then there is no way to supply it.

I will need to think more about this.

dydave’s picture

Component: Miscellaneous » Theme
Assigned: pukku » Unassigned
Issue summary: View changes
Status: Needs work » Closed (duplicate)

Very old issue.
Moved the work from #4 to #2487193: Support double quotes in the title attribute.

Changing component to Theme for the initial problem: using CSS to Support for width="123px", just in case some would be looking for more theme related information in the tracker.