improve the "category blog layout" code of com_content to pick out the image and separate it from texts

68 views
Skip to first unread message

Joomlagate China

unread,
Oct 5, 2016, 6:24:09 AM10/5/16
to joomla-...@googlegroups.com
hi,

I had posted this idea on Joomla.org forum:

http://forum.joomla.org/viewtopic.php?f=706&t=936289

Sorry for cross-posting here. I just want to be sure every Joomla
developer will see it.

If you think the best place for this idea is on Github issues, I will
also post there.

Thank you.


baijianpeng

https://www.joomlagate.com/

brian teeman

unread,
Oct 5, 2016, 6:40:50 AM10/5/16
to Joomla! CMS Development
As you stated on the forum the correct way to do this is to use the images and tabs option. Anything else would be impossible to manage. If you think it through and all the million possibilities that someone might enter content directly in the wysiwyg editor you will see you are trying to achieve the impossible. A method has been provided to achieve what you want to achieve - if thats what you want then you will have to use it.

Joomlagate China

unread,
Oct 5, 2016, 6:58:38 AM10/5/16
to joomla-...@googlegroups.com
hi, brian,

Do you mean that if image is inserted to WYSIWYG editor instead of
through the "image and links" tab, then it is impossible to separate
out for layout adjusting?

Well, I can NOT agree that the "image and links" tab is the best
solution. Because it requires the author who will creating/editing
article to know this trick ALL the time.

I think, Joomla should ease the burden of users, especially for those
who only knows writing in WYSIWYG editors.

Let's imagine such a situation: a website which allows registered
users to "submit articles from frontend", like "sharing your story".
For such a website, the Admin can not control who will register there,
maybe the user don't know Joomla very well. He can use the WYSIWYG
editor, but he may not know how to use "image and links" tab, or, even
after you put a reminding message above the editor, he may forget to
use it!

For such a website, how can the site Admin control the layout of
"category blog" to achieve the "image at left but texts at right"
effect? It is too difficult.

So, my suggestion is: improve the com_content component, maybe only
the "category blog layout" part, to handle this situation smartly :
whatever how many images the author had inserted above the "readmore"
line (maybe no image above that line or maybe he just forgot to insert
that line!) , the "layout" itself will just pick up the FIRST image in
his article to use it as the "cover image" on blog layout. The most
important point is, that image will be assigned special DIV container
and CSS class, completely separate from intro-texts, to make it
possible that the site Admin can use "HTML override" to align the
image left, then other things right.

The current pain is, Joomla core template for "category blog layout"
DID NOT separate the image from texts. The "introtext" word means
"everything above the readmore line". Do you think this is the best
way?

Than you.



baijianpeng

https://www.joomlagate.com/

- - - -


2016-10-05 18:40 GMT+08:00 'brian teeman' via Joomla! CMS Development
<joomla-...@googlegroups.com>:
> --
> You received this message because you are subscribed to the Google Groups
> "Joomla! CMS Development" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to joomla-dev-cm...@googlegroups.com.
> To post to this group, send email to joomla-...@googlegroups.com.
> Visit this group at https://groups.google.com/group/joomla-dev-cms.
> For more options, visit https://groups.google.com/d/optout.

Michael Babker

unread,
Oct 5, 2016, 7:57:06 AM10/5/16
to joomla-...@googlegroups.com
This is too complex to do in the layouts (it's going to put a lot of PHP code into layouts making it harder for users to understand), and what you're saying is exactly why there are the separate fields for images in the article manager.  Nothing stops you from being able to do this for your sites, but as a generalized solution in core the exact behavior you're describing isn't something that should be done.  The existing featureset should be used.

> As you stated on the forum the correct way to do this is to use the images
> and tabs option. Anything else would be impossible to manage. If you think
> it through and all the million possibilities that someone might enter
> content directly in the wysiwyg editor you will see you are trying to
> achieve the impossible. A method has been provided to achieve what you want
> to achieve - if thats what you want then you will have to use it.
>
>
> On Wednesday, 5 October 2016 11:24:09 UTC+1, Joomlagate China wrote:
>>
>> hi,
>>
>> I had posted this idea on Joomla.org forum:
>>
>> http://forum.joomla.org/viewtopic.php?f=706&t=936289
>>
>> Sorry for cross-posting here. I just want to be sure every Joomla
>> developer will see it.
>>
>> If you think the best place for this idea is on Github issues, I will
>> also post there.
>>
>> Thank you.
>>
>>
>> baijianpeng
>>
>> https://www.joomlagate.com/
>
> --
> You received this message because you are subscribed to the Google Groups
> "Joomla! CMS Development" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to joomla-dev-cms+unsubscribe@googlegroups.com.
> To post to this group, send email to joomla-dev-cms@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "Joomla! CMS Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to joomla-dev-cms+unsubscribe@googlegroups.com.
To post to this group, send an email to joomla-dev-cms@googlegroups.com.

Joomlagate China

unread,
Oct 6, 2016, 9:28:40 PM10/6/16
to joomla-...@googlegroups.com
hi,

I have a good news: Gruz , the author of AutoReadMore plugin (
https://extensions.joomla.org/extensions/extension/news-display/article-elements/autoreadmore
), had done a "blog layout overriding" file that will offer such a
nice layout!

Attached is the layout file. You also need to install the latest
version of AutoReadMore plugin, which will take care of the image
which was inserted into article content via the editor (not the
"images and links" Tab) and convert it so Joomla will "think" it was
inserted via that Tab.

This is an awesome trick, with this plugin , people will not worry
about the image any more. Just use Joomla editor as your favorite Word
Precessor, type in words, insert images, then AutoReadMore plugin will
do the rest to show the blog layout as "image at left side and text
and right side".

If you want to see the final effect, take a look at my temporary
testing project:

http://localhost/wix/index.php?option=com_content&view=category&layout=blog&id=79&Itemid=155

However, there is a little issue left: this layout is perfect on
desktop (big) screen, but on cell phone, it will not convert to "one
column" layout, which will make it a little ugly on small screens.

If anyone here knows how to improve the layout file (php) or the CSS
code to allow it shown as one-column on small screens, I means, really
responsive, please help me to iron it out.

Thank you.

baijianpeng

https://www.joomlagate.com/



- - - -
>> <joomla-...@googlegroups.com>:
>> > email to joomla-dev-cm...@googlegroups.com.
>> > To post to this group, send email to joomla-...@googlegroups.com.
>> > Visit this group at https://groups.google.com/group/joomla-dev-cms.
>> > For more options, visit https://groups.google.com/d/optout.
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Joomla! CMS Development" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to joomla-dev-cm...@googlegroups.com.
>> To post to this group, send an email to joomla-...@googlegroups.com.
>> Visit this group at https://groups.google.com/group/joomla-dev-cms.
>> For more options, visit https://groups.google.com/d/optout.
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Joomla! CMS Development" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to joomla-dev-cm...@googlegroups.com.
> To post to this group, send email to joomla-...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages