Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi,
I have seen: http://drupal.org/node/46415#comment-4603910 and imported this custom formatter (cf).
Now I would like to use this cf on a textfield long which is working
I made a new contenttype and added a textfield long to it and now I see the multiple column cf and selected it.
But how to get a newspaper like content output of this field please?
Thanks a lot in advance for your reply!
greetings, Martijn
Comment | File | Size | Author |
---|---|---|---|
#1 | newspaper_photo.jpg | 544.72 KB | Summit |
Comments
Comment #1
Summit CreditAttribution: Summit commentedHi,
I have it working now! I need to add images within the tekst, say in column 2 and 3 with a 5 columns lay-out.
Do you may be have a suggestion? I have now the image in the first column, but it is not looking nice.
See attachment how it looks like now.
Would be great if image high and width would also be part of the formula and may be the image size can be put on 1,2 or 3 columns?
This way with the custom formatter a great newspaper look can be build within a node!
Greetings, Martijn
Comment #2
Deciphered CreditAttribution: Deciphered commentedHi Summit,
It's a good idea, but would be tricky to make work, if I have some time I'll look further into it.
Comment #3
Summit CreditAttribution: Summit commentedHi,
I would really love this. I set it to active, because I didn't see another (non-programmer) solution anywhere on drupal.org if it's ok?
I tried
Would love to be able to have the newspaper-layout with image inclusion based on the custom formatter http://drupal.org/node/46415#comment-4603910.
may be with the height of the image as variable and the width of the image needs to be adapted by the sizes of the columns which the formula comes up with?
Just trying to think with you?
Thanks a lot in advance for your reply. Would be great if you would come up with a solution, than drupal can be used in an easy way for newspaper-layout also.
Special add-on what would be great is to be able to set the font type and font size also within the formula to arrange the columns nicely spread and on the bottom the same!
Greetings,
Martijn
Comment #4
Deciphered CreditAttribution: Deciphered commentedHi Martijn,
The biggest issue is that you'd need the font-height/line-height taken into account to calculate based on heights, whereas the existing solution just calculates based on character count. While it may be technically possible, and I might still look into it, this is definitely achievable with CSS3 Columns, and while I know that the reason I wrote the Formatter Approach in the first place is to support all non-CSS3 browsers and get the same effect, it might be a case of the complexity of the solution outweighs the benefits of supporting legacy browsers.
Too see it in practice, checkout http://www.quirksmode.org/css/multicolumn.html, and if you have Firebug you can edit the HTML of the columns example and stick an image in there, worked fine for me.
Cheers,
Deciphered.
Comment #5
Summit CreditAttribution: Summit commentedHi Deciphered,
I have seen his solution. There is a drupal module! http://drupal.org/project/multicolumn which makes a new input filter. But as you already explained it is not working for non-css3 browsers which is a necessity for my solution.
How about a solution in which the custom formatter calculates the font height/width and image height/width. I am not a programmer but the characters can then be calculated through font height/width and images through image height/width, right? Isn't that doable?
Greetings, Martijn
Comment #6
Deciphered CreditAttribution: Deciphered commentedHi Martijn,
I just want to make it clear the level of complexity of what you're asking.
To calculate the height of text you will not only need to know the font-size and line-height, you'll also need to know the width of words so you can calculate what words will wrap to the next line, you'll also need to know any heights for paragraph margin/padding, and any other modifiers like link styling. You'd need to take into account extra long words, which may or may not wrap based on the current css. And then you have to take into account that every browser is likely to render the text slightly differently, as is the same browser on different OSs.
It's not an easy thing your asking for, and certainly not something that I could fit into the limited spare time that I have. It's really a case of if a client had these specific needs I would do my best to talk them out of them, the cost for the payoff is not equal.
I would recommend 2 solutions:
- The CSS3 solution (which you've already said you can't use)
- Manually tailoring the content in a Wysiwyg (using Wysiwyg layouts maybe?)
I'm not saying I won't ever write a formatter to do this, but given the complexity it's very unlikely. I'll mark this issue as postponed in the case that I do have time or someone else wants to tackle it.
Comment #7
Summit CreditAttribution: Summit commentedHi Deciphered,
I understand what you are saying. I did the solution with ckeditor and building a table like this:
But now I have to copy/paste finetune on and on..to get the newsaper look..Would be great if someone came up with an easy drupal solution!
Greetings, Martijn
Comment #8
DYdave CreditAttribution: DYdave commentedHi Summit,
I was browsing around while investigating another issue and came across this post.
I was wondering if you ever considered using something like the Masonry module which seems to do exactly what you would be looking for with the "newspaper look".
It seems to implement the layout with Javascript based on the Jquery Masonry plugin.
I hope this could work for you and would be glad to hear your feedback on this.
Hope that helps.
Cheers!
Comment #9
Deciphered CreditAttribution: Deciphered commented