21
alain01
Re: My overloads of the templates search.tpl and userinfo.tpl
  • 2021/11/11 17:34

  • alain01

  • Just can't stay away

  • Posts: 528

  • Since: 2003/6/20


Thank you.
Here, The relevant PR : https://github.com/XOOPS/XoopsCore25/pull/1124



22
alain01
Re: Home Page
  • 2021/11/11 10:53

  • alain01

  • Just can't stay away

  • Posts: 528

  • Since: 2003/6/20


Ok, well done !
Is the website visible? (url ?)



23
alain01
Re: Home Page
  • 2021/11/6 21:09

  • alain01

  • Just can't stay away

  • Posts: 528

  • Since: 2003/6/20


Using custom blocks is indeed much easier.
No need for php.
As Mamba proposed in his first answer, there is the solution to act in the theme.tpl file

The best is to use the available tools which are the management of the custom blocks but if we want to use tpl files, we could do this :

In the theme.tpl
<{if $xoops_page == "index"}>
    <{include 
file="$theme_name/tpl/my_content.tpl"}>
<{/if}>

and in the file my_content.tpl
<{if $xoops_isuser|default:false}>
     <
h3>My content for members</h3>
    <
p>Content here</p>
<{else}>
     <
h3>My content for anonymous</h3>
    <
p>Content here</p>
<{/if}>



24
alain01
Re: Home Page
  • 2021/11/6 18:40

  • alain01

  • Just can't stay away

  • Posts: 528

  • Since: 2003/6/20


There is a very simple solution.
You just have to add 2 custom blocks only on the homepage and on the top for example.
"block-anonynous" : with content and visible only to anonymous people
"members-block" : with content and visible only for connected members.
This is a very simple and effective solution.

Do you understand the principle?



25
alain01
Re: Most current Xoops 2.5.11
  • 2021/10/25 7:48

  • alain01

  • Just can't stay away

  • Posts: 528

  • Since: 2003/6/20


Hey,
you can change this jgrowl redirection, here:

/modules/system/admin.php?fct=preferences&op=show&confcat_id=1#redirect_message_ajax1



26
alain01
My overloads of the templates search.tpl and userinfo.tpl
  • 2021/10/22 12:48

  • alain01

  • Just can't stay away

  • Posts: 528

  • Since: 2003/6/20


I just finalized the overload of the templates search.tpl (Module system) and userinfo.tpl (Module profile).

- I added an "automatic" image overload mode.
If image overloading is present then use it otherwise use the default image

- I modernized the page with a presentation by module in cards
I also changed the location of some elements in order to have an optimal reading

- I replaced "<< Previous Next >>" with nice buttons.
They are now always visible and are simply disabled if the Next or Previous page does not exist

- I also optimized the width and so now the display is responsive.

Links :
Search:
https://www.monxoops.fr/search.php?query=xswatch4&action=results&lang=english
Userinfo :
https://www.monxoops.fr/modules/profile/userinfo.php?uid=2&lang=english

Please leave your comments and suggestions.

Finally, once completed, I could propose a Pull Request of these 2 templates in the xswatch4 theme in the core



27
alain01
Re: Overload the images on the search.php page
  • 2021/10/21 7:37

  • alain01

  • Just can't stay away

  • Posts: 528

  • Since: 2003/6/20


Ok, so much the better, this solution was my preference.
Thank you for this information on good practices



28
alain01
Re: Overload the images on the search.php page
  • 2021/10/21 6:58

  • alain01

  • Just can't stay away

  • Posts: 528

  • Since: 2003/6/20


Ok,
So, last question

The result is same but I want to know if a solution is better:

Readable test:
<{if file_exists($path_image_full_overloaded)}>
    <
div class="d-inline"><img src="<{$url_image_overloaded}>" title="<{$data.image_title}>" alt="<{$data.image_title}>"/> <a href="<{$data.link}>"><{$data.link_title}></a></div>
 <{else}>
    <
div class="d-inline"><img src="<{$data.image_link}>" title="<{$data.image_title}>" alt="<{$data.image_title}>"/> <a href="<{$data.link}>"><{$data.link_title}></a></div>
<{/if}>

or
Condensed test :
<div class="d-inline">
    <
img src=<{if file_exists($path_image_full_overloaded)}>"<{$url_image_overloaded}>"<{else}>"<{$data.image_link}>"<{/if}> title="<{$data.image_title}>" alt="<{$data.image_title}>"/> <a href="<{$data.link}>"><{$data.link_title}></a>
    </
div>



29
alain01
Re: Overload the images on the search.php page
  • 2021/10/21 0:38

  • alain01

  • Just can't stay away

  • Posts: 528

  • Since: 2003/6/20


Yesssssssssssssssssssss §
I found it !

Thank you zyspec for your explanation and Mamba for your examples and links.

I found a solution with paramaters, no hard coded.
It was hard for me but it works.
Code :

<{foreach item=data from=$search.module_data}>

    <{
assign var="url_image_overloaded" value=$xoops_imageurl|cat:$data.image_link}>
    <{
assign var="path_image_begin_overloaded" value=$xoops_rootpath|cat:"/themes/"|cat:$xoops_theme}>
    <{
assign var="path_image_full_overloaded" value=$path_image_begin_overloaded|cat:"/"|cat:$data.image_link}>

    <{if 
file_exists($path_image_full_overloaded)}>
        <
img src="<{$url_image_overloaded}>" alt="<{$data.image_title}>"title="<{$data.image_title}>"> <a href="<{$data.link}>"><{$data.link_title}></a>
    <{else}>
        <
img src="<{$data.image_link}>" title="<{$data.image_title}>" alt="<{$data.image_title}>"/> <a href="<{$data.link}>"><{$data.link_title}></a>
    <{/if}>
    <
br />
<{/foreach}>



30
alain01
Re: Overload the images on the search.php page
  • 2021/10/20 22:35

  • alain01

  • Just can't stay away

  • Posts: 528

  • Since: 2003/6/20


Quote:
Mamba wrote:
<{foreach item=data from=$search.module_data}>
<{*----------- new 
code start -------------*}>
            <{
assign var="module_name" value=$search.module_name|lower}>
            <{
assign var="image" value="themes/xbootstrap/modules/$module_name/images/search.png"}>

No !
Cause the module_name is the label name and not the module name.

Example ?
module xmnews
Name : xmnews
label : The articles




TopTop
« 1 2 (3) 4 5 6 ... 38 »



Login

Who's Online

251 user(s) are online (171 user(s) are browsing Support Forums)


Members: 0


Guests: 251


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