1
zivXP
Output of images in the block
  • 2023/2/19 10:52

  • zivXP

  • Not too shy to talk

  • Posts: 113

  • Since: 2006/2/9 1


Module "publisher". How to make sure that only one image is displayed in block "In the Spotlight!"?
Make an image output only for the last article.
May restrict the database request?

2
zivXP
Re: Output of images in the block
  • 2023/2/19 13:22

  • zivXP

  • Not too shy to talk

  • Posts: 113

  • Since: 2006/2/9 1


How to edit correctly publisher_items_spot.tpl?
So that only the first article displays <{$item.image_path}>?

<{foreach item=item from=$block.items name=spotlight}>
<{if $item.summary != ''}>
<div>
<{if $item.image_path}>
<a href="<{$item.itemurl}>"><img src="<{$item.image_path}>" align="right" alt="<{$item.clean_title}>" title="<{$item.clean_title}>"></a>
<{/if}>
<{$item.summary}>
</div>
<{/if}>
<{/foreach}>

3
heyula
Re: Output of images in the block
  • 2023/2/19 14:12

  • heyula

  • Theme Designer

  • Posts: 590

  • Since: 2008/4/24


Quote:
zivXP wrote: How to edit correctly publisher_items_spot.tpl? So that only the first article displays <{$item.image_path}>?
<{foreach item=item from=$block.items name=spotlight}>
        <{if 
$item.summary != ''}>
              <
div>
                    <{if 
$item.image_path}>
                        <
a href="<{$item.itemurl}>"><img src="<{$item.image_path}>" align="right" alt="<{$item.clean_title}>" title="<{$item.clean_title}>"></a>
                    <{/if}>
            <{
$item.summary}>
                </
div>
        <{/if}>
    <{/foreach}>
It will show yes if you make the settings as below. Resized Image
Resized Image
But my advice is to create the blocks using this plugin, which is much more dynamic. New Block for Publisher Module

4
zivXP
Re: Output of images in the block
  • 2023/2/19 15:04

  • zivXP

  • Not too shy to talk

  • Posts: 113

  • Since: 2006/2/9 1


It is necessary to display the image in the block only for the first article, the rest of the articles without images.
Will it be possible to do this?

5
heyula
Re: Output of images in the block
  • 2023/2/19 17:59

  • heyula

  • Theme Designer

  • Posts: 590

  • Since: 2008/4/24


Quote:

zivXP wrote:
It is necessary to display the image in the block only for the first article, the rest of the articles without images.
Will it be possible to do this?


Yes you can do this with the following:

https://xoops.org/modules/newbb/viewtopic.php?topic_id=79187

6
heyula
Re: Output of images in the block
  • 2023/2/19 18:04

  • heyula

  • Theme Designer

  • Posts: 590

  • Since: 2008/4/24


If I understand correctly you want to do something like this

Resized Image


New Block for Publisher Module

7
zivXP
Re: Output of images in the block
  • 2023/2/19 18:45

  • zivXP

  • Not too shy to talk

  • Posts: 113

  • Since: 2006/2/9 1


I want to do something like this, but on a module publisher.

Resized Image

I will try your hack reviews.
Thank you.

8
heyula
Re: Output of images in the block
  • 2023/2/19 18:55

  • heyula

  • Theme Designer

  • Posts: 590

  • Since: 2008/4/24


ok you can do much better.

If you want, install the publisher module and send the ftp information, I'll do it.

As an example, the following site was made with the code block I gave you

Resized Image


Demo:
https://www.ilkguninsaat.com/

In short, you can do whatever you want.

9
zivXP
Re: Output of images in the block
  • 2023/2/21 10:11

  • zivXP

  • Not too shy to talk

  • Posts: 113

  • Since: 2006/2/9 1


Quote:

heyula wrote:
As an example, the following site was made with the code block I gave you


Unfortunately, I could not launch such a block on my website.
An error message is displayed: A problem has occurred on our server!
Error: Class 'PublisherHelper' not found.

Could you write in more detail how to do this?

Inserted into the subject: <{includeq file="$theme_name/date-news.tpl"}>
The file date-news.tpl is located in themes/xbootstrap
The contents of the file as you specified.

10
heyula
Re: Output of images in the block
  • 2023/2/21 12:25

  • heyula

  • Theme Designer

  • Posts: 590

  • Since: 2008/4/24


Quote:
zivXP wrote: Quote:
heyula wrote: As an example, the following site was made with the code block I gave you
Unfortunately, I could not launch such a block on my website. An error message is displayed: A problem has occurred on our server! Error: Class 'PublisherHelper' not found. Could you write in more detail how to do this? Inserted into the subject: <{includeq file="$theme_name/date-news.tpl"}> The file date-news.tpl is located in themes/xbootstrap The contents of the file as you specified.
The version of the publisher module you are using is outdated. You are getting this error because the classes in the older versions of the publisher are not the same as the new versions.

Login

Who's Online

203 user(s) are online (123 user(s) are browsing Support Forums)


Members: 0


Guests: 203


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Mar 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits