joomla / joomla-cms

Home of the Joomla! Content Management System
https://www.joomla.org
GNU General Public License v2.0
4.74k stars 3.64k forks source link

Custom Banners don't function as appears #19596

Closed N6REJ closed 6 years ago

N6REJ commented 6 years ago

Steps to reproduce the issue

Create a banner using "custom" as the type. The put in the custom image code in the "custom code" field and the click url in the "click url field"

Expected result

banner created with image linked.

Actual result

image but no link.

System information (as much as possible)

systeminfo-2018-02-07T07_56_11+00_00.txt

Additional comments

image

As you can see the information is ambiguous at best. IF in fact custom code should have the full html ( which seems silly since we have an editor ) then what purpose is the click url serving? IF the click URL is proper, then why is it not functioning? I looked around and could find no documentation that seemed to indicate what was what. The help page doesn't contain any information about the custom form at all. Might actually make more sense if the custom form was just the editor.

Quy commented 6 years ago

I had to look in the code. <?php echo str_replace(array('{CLICKURL}', '{NAME}'), array($link, $item->name), $item->custombannercode); ?>

Yes enter full html with 2 available placeholders {CLICKURL} and {NAME}. For example: <a href="{CLICKURL}"><img src="enter url to image" alt="{NAME}" title="{NAME}"></a>

N6REJ commented 6 years ago

thanks @Quy really sad that NONE of this is documented and there is a ton of redundancy. From what you've posted it appears $item-custombannercode is not being used?

Quy commented 6 years ago

$item-custombannercode is the HTML code. If your HTML code has placeholders, then they will be replaced with Name and Click URL values accordingly. The Custom Code tooltip could be improved to include the placeholders info.

ghost commented 6 years ago

Can someone set Label "Needs Documentation"?

brianteeman commented 6 years ago

Better yet can one of you write the documentation and them this can be closed

N6REJ commented 6 years ago

@brianteeman I had already planned on adding this to my J! video set but w/o clear understanding i clearly can't do so. @Quy have you actually tried it? Cause thats not how it actually behaves. If you don't include the <a href in the "customcode" section, you get only the image. here's a real example.. image image image image

Putting in image in the editor are does nothing! image image

So, as you can see, its not working anywhere near the way any of us expect

N6REJ commented 6 years ago

@brianteeman how logical is it to you that clickurl remain but everything else pulls from the editor? OR , leave JUST the editor?

Quy commented 6 years ago

Yes. You have to build the entire HTML markup as follows: <a href="{CLICKURL}"><img src="enter url to image" alt="{NAME}" title="{NAME}"></a>

You don't have to use the placeholders and use your own tracking code outside of Joomla.

I assume with custom code that you have more control over its markup.

N6REJ commented 6 years ago

@Quy that is TOTALLY counter inuitive This is making no sense why its designed this way. imo the following changes need to be done.. 1) remove "description" editor 2) move click url to first field position 3) change Custom Code field type to editor THEN, anything that lives within click url field can go into the {clickurl} section in the editor. If that doesn't exist then don't use it! 4) Document this view! NOW, the next question become do these 2 fields exist for tracking purposes?

mbabker commented 6 years ago

change Custom Code field type to editor

Can't do. This is intended to be an HTML input, not a WYSIWYG editor, and honestly even loading CodeMirror here is overkill (not to mention with our WYSIWYG configs you end up going through extra filtering, you're going to get the intended markup stripped out most likely in that case).

remove "description" editor

Propose for 4.0. Any field that exists now in the data schema can't be removed for B/C reasons (though unused in core it is entirely possible for someone with a layout override or custom integration to use it).

brianteeman commented 6 years ago

Please calm down. I am not saying anything is perfect but its been this way for X years, you just noticed it so please stop with the demanding things

N6REJ commented 6 years ago

@brianteeman who's demanding? idk what your issue is with me but your often pretentious towards my posts. I made a statement about a rarely used feature of banners, that has ZERO documentation, noticing their bugs and recommended fix.

brianteeman commented 6 years ago

Has the documentation been updated? This isnt a code issue but a documentation issue.

Quy commented 6 years ago

Would this be enough for the tooltip?

Before:

Select Custom to enter your custom code.

After:

Select Custom to enter your custom code. Use {CLICKURL} and {NAME} to merge 'Click URL' and 'Name' values respectively into your custom code.

brianteeman commented 6 years ago

my 2c is that this belongs in the documentation wiki - not the tooltip

Quy commented 6 years ago

I assume it is this page: https://docs.joomla.org/Help38:Components_Banners_Banners_Edit However, it is not obvious how to submit changes.

brianteeman commented 6 years ago

there is a help menu in the blue bar

Quy commented 6 years ago

@infograf768 Do you know where else to update the doc? The above link has placeholders and not the actual text. Thanks.

infograf768 commented 6 years ago

@Quy That one is a bit more complex than just editing the help screen. As you can see, there is a only one screenshot for the banner type Image, which means a new screenshot should be added when using custom and a new Details added. plus indeed the fact that has to be edited the placeholder stuff. Let me contact who is in charge of this and ask her to help you here.

infograf768 commented 6 years ago

@Quy Sandra added some stuff to that help screen. You can modify (add other possible code) on this page

https://docs.joomla.org/Chunk30:Help_screen_column_header_Detail_Tab_Banner_Edit

Sandra97 commented 6 years ago

After some tests, any HTML code works fine. I tried with <div class="center"><a href="https://shop.joomla.org"><img src="images/banners/shop-ad.jpg"><br />Buy your Joomla swag now!</a></div> All is displayed as expected. The link works fine, text and image are displayed.

ghost commented 6 years ago

@N6REJ can you please retest if you have this Issue still?

joomla-cms-bot commented 6 years ago

Set to "closed" on behalf of @Quy by The JTracker Application at issues.joomla.org/joomla-cms/19596

Quy commented 6 years ago

Documentation updated.


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