?
Referenced as Pull Request for: # 9865
avatar rgmears
rgmears
10 Apr 2016

This references a post on the Forum: Intro image not showing J 3.5

Steps to reproduce the issue

  • Create an article containing an "intro text" and "full text" (IE: it must have a "readmore" break)
  • Under Images and Links, add Intro Image and Full Article Image
  • Set Article "Access" to Registered
  • Create two menu items:
  • A "Category Blog" menu item for the category containing the above article
  • A "Single Article" menu item, for the above article
  • Set Article Menu Item "Access" to Public

IMPORTANT:

  • Have "Show Unauthorized Links" set to Yes. (Best if this is the global option.)

Test this:

Access the two menu items (the "Blog" and the "Single Article") while not logged in.

Expected result

The Intro Image should be displayed, in both views.

Actual result

The Intro Image is displayed only in the "Category Blog" view, while in the "Single article" view no image is displayed.

System Info

Joomla 3.5.1, Protostar

Additional comments

Of course, once logged in, the Intro Image displays on the Blog page while the Full Article Image displays on the Single Article page.

Since, the Intro Text displays (when not logged in) it would make sense that the Intro Image also displays.

avatar rgmears rgmears - open - 10 Apr 2016
avatar rgmears
rgmears - comment - 10 Apr 2016

This fix from @smz works.

Change is:

<?php if (isset($images->image_intro) && !empty($images->image_intro)) : ?>
<?php $imgfloat = (empty($images->float_fulltext)) ? $params->get('float_fulltext') : $images->float_fulltext; ?>
<div class="pull-<?php echo htmlspecialchars($imgfloat); ?> item-image"> <img
<?php if ($images->image_intro_caption):
    echo 'class="caption"' . ' title="' . htmlspecialchars($images->image_intro_caption) . '"';
endif; ?>
src="<?php echo htmlspecialchars($images->image_intro); ?>" alt="<?php echo htmlspecialchars($images->image_intro_alt); ?>" itemprop="image"/> </div>
<?php endif; ?>

added before line 136 <?php echo $this->item->introtext; ?>

File is templates/protostar/html/com_content/article/default.php


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/9830.

avatar smz
smz - comment - 10 Apr 2016

DELETED

Sorry, it was meant to be a private answer to @rgmears

My bad!

avatar smz
smz - comment - 10 Apr 2016

actually my code is a sloppy and quick copy-replace-paste job form the "full text" image part in which I now see there are very wrong parameters (e.g. $params->get('float_fulltext')) and I told Robert it was untested!!!

How to say in these cases... maybe "I disown him as my son!" :stuck_out_tongue_winking_eye:

avatar smz
smz - comment - 10 Apr 2016

Just in case, a better solution could be to simply use:

<?php echo JLayoutHelper::render('joomla.content.intro_image', $this->item); ?>

UNTESTED!!

(N.B.: injecting $this->item into the Jlayout is IMHO wrong, but this is the way it is now done in the blog's blog_item.php sub-template)

avatar rgmears
rgmears - comment - 10 Apr 2016

Apologies @smz.

Since I use CSS and not the float choice built into the admin options, I didn't notice.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/9830.

avatar smz
smz - comment - 10 Apr 2016

No prob, @rgmears ! :smile:

avatar rgmears
rgmears - comment - 10 Apr 2016

Your second solution works too. Although if one wanted the float and the caption then the original would be preferable.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/9830.

avatar smz
smz - comment - 10 Apr 2016

... hmmm float should work with the JLayouts too (by setting the option in "Images and Links")
... and caption too

avatar rgmears
rgmears - comment - 10 Apr 2016

You're correct. Float works. And so does the caption. Thanks for the fix.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/9830.

avatar smz
smz - comment - 10 Apr 2016

You're welcome!

avatar rgmears
rgmears - comment - 10 Apr 2016

Should I turn this into a pull request?


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/9830.

avatar smz
smz - comment - 10 Apr 2016

If you're asking me, of course you can! :+1:

avatar Webdongle
Webdongle - comment - 10 Apr 2016

@rgmears

Test this:

Access the two menu items (the "Blog" and the "Single Article") while not logged in.
Expected result

The Intro Image should be displayed, in both views.

Would disagree because the intro image is for blog and featured not single Articles

intro image 01

avatar smz
smz - comment - 10 Apr 2016

one could argue that comment in code (line 134) says:
<?php // Optional teaser intro text for guests ?>

avatar rgmears
rgmears - comment - 10 Apr 2016

I agree with @smz.
<?php // Optional teaser intro text for guests ?>
would then be
<?php // Optional teaser intro text and/or image for guests ?>

I cannot be the only person who has encountered this.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/9830.

avatar smz
smz - comment - 10 Apr 2016

Well, not precisely:

what I mean is that the option description says

Image for intro text layouts such as blogs and featured

  • "such" is not exclusive (it is an example, not an exhaustive list of cases)
  • what is displayed to guest is the intro text
  • the image is for the intro text
  • the image should be displayed
  • Q.E.D.
avatar Webdongle
Webdongle - comment - 11 Apr 2016

Image for intro text layouts such as blogs and featured

Intro text layouts are designed to display only the into text part of an Article. A non logged in user is not seeing an intro text layout ... the non logged in user is seeing an Article layout.. And an Article layout is a full text layout because ... the amount of the Article layout that a non logged in user sees is dependant on Permissions not on the Article layout.

Blogs/ featured pages and the Article Category Module are 'intro text layouts' because they are designed to display intro text not the full text of the Article.

There could be a case for displaying the Full Article image but not for displaying the intro text.

Addendum

what is displayed to guest is the intro text

But it is not being displayed in an 'intro text layout'. The default.php that is displaying it is a full text layout. The intro text image relates to the layout that is displaying it not the amount of that layout that is being displayed.

avatar smz
smz - comment - 11 Apr 2016

Kevin, if there is a consensus that things must be left as they are as otherwise some (not many I estimate) sites could have a surprise, so be it: not big deal, especially for me: I never use "Images and links". The beauty of being able to roll your own overrides is that anybody can tailor this details to his/her needs.


That said, my feeling is that a new user (think of a "blogger"), just exposed to Joomla, with no knowledge of what menu items, views, templates, layouts and JLayouts are, not to talk about the MVC architecture, would expect that "intro image" is displayed when, for whatever reasons, the "intro text" is displayed, and the "full text image" is displayed when "full text" is displayed.

avatar rgmears
rgmears - comment - 11 Apr 2016

@Webdongle

Intro text layouts are designed to display only the into text part of an Article.

Why then are Intro Images displayed as part of Intro Text in the Blog Layout?

What you are saying defies logic.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/9830.

avatar Webdongle
Webdongle - comment - 11 Apr 2016

@rgmears

Why then are Intro Images displayed as part of Intro Text in the Blog Layout?

Because the default.php for a Blog Layout is designed to display intro text (of an Article) ONLY. So by definition it is a "Intro text layout".

@smz

if there is a consensus that things must be left as they

Things do change but it's up to the devs as to what changes and why. All I am doing is giving my interpretation of the meaning of the tool tip. For some reason they (the powers that be) have chosen the term 'Image for intro text layouts' not 'image to display with intro text'.

imho there is a vast difference between 'Image for intro text layouts' and 'image to display with intro text'. Why that specific wording was chosen I don't know for sure but my opinion is because it fits in with the logic of the different types of layout.

I do see your point but (to me) it seems illogical to display the intro text in a full text (Article) layout just because that layout is restricting what is being displayed.

It would be interesting to hear from @brianteeman as to why that particular wording was chosen for the tool tip. And to hear from @mbabker the programming implications of such a change

avatar rgmears
rgmears - comment - 11 Apr 2016

@Webdongle

Because the default.php for a Blog Layout is designed to display intro text ONLY. So by definition it is a "Intro text layout".

What you are saying is not what happens. In Blog layout -- whether the Article is "Public" or "Registered" -- the Intro Image displays before the Intro Text. So, it is not Intro Text ONLY. It is Intro Image and Intro Text together (if an Intro Image has been selected).


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/9830.

avatar brianteeman
brianteeman - comment - 11 Apr 2016

AS i've been tagged i've read the entire thread and to be perfectly honest I am completely confused because as soon as i undertsand the comment one of you makes you then contradict yourselves.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/9830.

avatar brianteeman
brianteeman - comment - 11 Apr 2016

The Intro Image is displayed only in the "Category Blog" view, while in the "Single article" view no image is displayed.

That is exactly what I would expect to happen and it exactly what the tooltips say will happen


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/9830.

avatar Webdongle
Webdongle - comment - 11 Apr 2016

@rgmears

In Blog layout -- whether the Article is "Public" or "Registered" -- the Intro Image displays before the Intro Text. So, it is not Intro Text ONLY. It is Intro Image and Intro Text together (if an Intro Image has been selected).

You are taking the word 'only out' of context.
Blog (page) is an 'intro text layout' ... because the core blog default.php is only capable of displaying the intro text of an Article
Article (page) is not an 'intro text layout' ...because the core article default.php is capable of displaying all the text. Even if an Article (page) just displays the intro text it is still not an 'intro text layout'

@brianteeman

The Intro Image is displayed only in the "Category Blog" view, while in the "Single article" view no image is displayed.

That is exactly what I would expect to happen and it exactly what the tooltips say will happen
Article is not an 'intro text' layout. If an Article Displays

Thank you for taking the time to read and comment

avatar rgmears
rgmears - comment - 11 Apr 2016

@Webdongle

Blog (page) is an 'intro text layout' ... because the core blog default.php is only capable of displaying the intro text of an Article

Why then does the Intro Image display in Blog Layout?

Even if an Article (page) just displays the intro text it is still not an 'intro text layout'

It may not be an 'intro text layout' but it is Intro Text being displayed when the Article is set to display for Registered Users.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/9830.

avatar brianteeman
brianteeman - comment - 11 Apr 2016

Sorry @rgmears but you are really flogging a dead horse

When you are in a blog or featured view then the intro text and any intro image will be displayed

When you are in a single article view then the intro text will display (unless set to not be displayed in the options) and any full image will be displayed.

This is working exactly as the documentation and the tooltips describe


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/9830.

avatar rgmears
rgmears - comment - 11 Apr 2016

@brianteeman

...you then contradict yourselves.

I believe my statements to be consistent.

  • Intro Image should display wherever Intro Text displays.

That this doesn't happen (without @smz's fix) baffles me.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/9830.

avatar brianteeman
brianteeman - comment - 11 Apr 2016

To make sure there is no misunderstanding
I have made a video of creating an article with an intro image and full
image and set it to be registered
It is a completely clean install of 3.5.1 with nothing installed
I used the feature layout for speed but it is exactly the same with a blog
category

https://www.dropbox.com/s/e3u7tnppzvmwtrj/9830.mp4?dl=0

avatar rgmears
rgmears - comment - 11 Apr 2016

@brianteeman

you are really flogging a dead horse

Try what is suggested at the top of this post. Add a Menu Item to your article, set it to public, and click on it.

You will see the "Intro Text" followed by a "Register to read more" button.

Regardless what the (tiny, hard to read) Tooltip says, what happens in the above scenario is not what this User expected.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/9830.

avatar Webdongle
Webdongle - comment - 11 Apr 2016

@rgmears

Why then does the Intro Image display in Blog Layout?

Because the Blog (page) is displayed by the blog default.php which is an 'intro text layout'. And the intro image displays on pages that are an 'intro text layout'.

Even if an Article (page) just displays the intro text it is still not an 'intro text layout'

It may not be an 'intro text layout' but it is Intro Text being displayed when the Article is set to display for Registered Users.

I can see your confusion. Because the terms 'intro image' and 'intro text' both contain the word 'intro' you you see them as two entities that are mutually inclusive. They are two separate entities that are controlled separately

The word 'intro' in 'intro image'; refers to the .type of layout it is displayed in. (Conditional)
The word 'intro' in 'intro text'; refers to the amount of text that is being displayed.(variable)

avatar brianteeman
brianteeman - comment - 11 Apr 2016

OK I see what you mean - single articles is not something I usually do -
should be easy to do a PR to fix that which I will do in the morning.

Not sure if it will be backwards compatible but someone else can make a
call on that

On 12 April 2016 at 00:28, Kevin Griffiths notifications@github.com wrote:

@rgmears https://github.com/rgmears

Why then does the Intro Image display in Blog Layout?

Because the Blog (page) is displayed by the blog default.php which is an
'intro text layout'. And the intro image displays on pages that are an
'intro text layout'.

Even if an Article (page) just displays the intro text it is still not an
'intro text layout'

It may not be an 'intro text layout' but it is Intro Text being displayed
when the Article is set to display for Registered Users.

I can see your confusion. Because the terms 'intro image' and 'intro text'
both contain the word 'intro' you you see them as two entities that are
mutually inclusive. They are two separate entities that are controlled
separately

The word 'intro' in 'intro image'; refers to the .type of layout it is
displayed in. (Conditional)
The word 'intro' in 'intro text'; refers to the amount of text that is
being displayed.(variable)


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
#9830 (comment)

Brian Teeman
Co-founder Joomla! and OpenSourceMatters Inc.
http://brian.teeman.net/

avatar rgmears
rgmears - comment - 11 Apr 2016

Thanks @brianteeman

If you would provide a bit of guidance, I could do the Pull Request for this.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/9830.

avatar brianteeman
brianteeman - comment - 11 Apr 2016

Its ok - will submit in 5 minutes - better code than suggested before as it
uses the layout correctly and the plugins (i hope)

On 12 April 2016 at 00:42, Robert G Mears notifications@github.com wrote:

Thanks @brianteeman https://github.com/brianteeman

If you would provide a bit of guidance, I could do the Pull Request for

this.

This comment was created with the J!Tracker Application
https://github.com/joomla/jissues at issues.joomla.org/joomla-cms/9830
https://issues.joomla.org/tracker/joomla-cms/9830.


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
#9830 (comment)

Brian Teeman
Co-founder Joomla! and OpenSourceMatters Inc.
http://brian.teeman.net/

avatar brianteeman brianteeman - close - 11 Apr 2016
avatar brianteeman brianteeman - change - 11 Apr 2016
Status New Closed
Closed_Date 0000-00-00 00:00:00 2016-04-11 23:52:47
Closed_By brianteeman
avatar brianteeman
brianteeman - comment - 11 Apr 2016

Closed - please test #9865

(Note - talking about the blog category in the original post was confusing)


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/9830.

Add a Comment

Login with GitHub to post a comment