WBCE CMS – Way Better Content Editing.
You are not logged in.
I have some posts which do not have any content in the Content Long Text box, but do have some photos in the gallery.
In News with Images, the Read More link appears in this case because I assume the check must look for Content Long OR images
<span style="visibility:[SHOW_READ_MORE];"><a href="[LINK]">[TEXT_READ_MORE]</a></span>
But in News with Images Anywhere, the Read More link does not appear because the Template looks for"news.CONTENT_LONG" and since there is nothing in the Content Long it skips the Read More link.
{% if news.CONTENT_LONG %}
<a href="{{ news.LINK }}">{{ lang.TXT_READMORE }}</a>
{% endif %}
Is there a way to make Anywhere check or both Content Long AND Images in the photo gallery?
Offline
I see the problem.
1. The really quick&dirty solution: Just hit Return one time in the long text field and save.
2. You can either change the lines in the /modules/news_img_anywhere/templates/display_mode_1.htt (or the template you use)
{% if news.CONTENT_LONG %}
<a href="{{ news.LINK }}">{{ lang.TXT_READMORE }}</a>
{% endif %}
to
<a href="{{ news.LINK }}">{{ lang.TXT_READMORE }}</a>
This leads to that the read more link is always displayed, even if there's neither a long text nor there are gallery images.
3. To avoid this, you have to apply changes to the news_img_anywhere/include.php file too:
In the /modules/news_img_anywhere/include.php, after
$nimage = $row['image'];
if ($row['image']!='' && file_exists(WB_PATH . MEDIA_DIRECTORY . '/.news_img/'.$row['post_id'].'/' . $nimage)) {
$nimage = WB_URL . MEDIA_DIRECTORY . '/.news_img/'.$row['post_id'].'/' . $nimage;
}
add
$hasgalleryimages = false;
$sql_result = $database->query("SELECT * FROM ".TABLE_PREFIX."mod_news_img_img WHERE post_id = ".$row['post_id']);
$anz_post_img = $sql_result->numRows();
if ($anz_post_img>0) {$hasgalleryimages=true;}
after
'IMAGE' => $nimage,
add
'HASGALLERYIMAGES' => $hasgalleryimages
in the /modules/news_img_anwhere/templates/display_mode_1.htt (or the template you use) change
{% if news.CONTENT_LONG %}
to
{% if (news.CONTENT_LONG or news.HASGALLERYIMAGES) %}
So the read more link will also appear if there is no long text, but gallery images.
Sorgen sind wie Nudeln: man macht sich meist zu viele.
Offline
giz, losttrip
I chose option three and it works beautifully. Thank you!
I had already considered option 1, but telling clients they have to hit return in a blank text box would likely just lead to future headaches... because they wouldn't remember to do it.
I tried option 2 already, but clicking Read More on a post with no long content, would lead to a page with nothing more than duplicate content which is not a good user experience.
So, I am very happy you took the time to provide a full solution. Perhaps this could be considered as part of the next version?
-------------
A quick note - I initially went to edit the include.php file through cwsoft-addon-file-editor and the editor showed no content:
I then went into the file on my server and the content was there. Any idea why the cwsoft-addon-file-editor wouldn't show the content of include.php?
Offline
Just as a side note, I created an issue for NWI (not "Anywhere") to fix it there, too.
Ich habe eine Amazon-Wishlist. Oder spende an das Projekt.
Ich kann, wenn ich will, aber wer will, dass ich muss, kann mich mal
Offline
losttrip
A quick note - I initially went to edit the include.php file through cwsoft-addon-file-editor and the editor showed no content:
The NIA files are saved in ANSI charset instead of UTF-8 unfortunately, and the AFE fails to load them.
Sorgen sind wie Nudeln: man macht sich meist zu viele.
Offline
I've published a bugfix release 0.1.2 with all files converted to UTF-8 and the changes to the include.php / display_mode_1.htt mentioned above.
Sorgen sind wie Nudeln: man macht sich meist zu viele.
Offline
webbird, losttrip
I just upgraded NWI anywhere from 0.1.2 to 0.3 (from the AOR - https://addons.wbce.org/pages/addons.ph … m&item=115 ) and 0.3 doesn't seem to have the $hasgalleryimages fixes you implemented. So, once again, when I have ONLY a gallery on the details page, there is no "read more" link on the overview page.
Offline
Pls find the fixed version in the AOR
Sorgen sind wie Nudeln: man macht sich meist zu viele.
Offline
losttrip
Thank you for your effort. Works as expected.
Offline