Subject:*
<
Name/Email:*
<
Message Icon:*
<
Select*
<
Message:*
<



Click the Preview to see the content in action.
Options:*
<
Confirmation Code*
<
6 - 0 = ?  
Input the result from the expression
Maximum attempts you can try: 10
*
<
   

Re: Embedding PHP code in theme template?
by BlueStocking on 2007/4/26 20:22:24

The WHY it did not work for me, was because I was using the "default" template. YOU/I MUST use a different cloned template. In my case I named a cloned template "defaultclone"
and edited that from the
ADMIN/ BLOCKS/ MAIN MENU/ | Template Set Manager >> defaultclone >> Edit template file.

Thank you all....
BlueStocking
Re: Embedding PHP code in theme template?
by BlueStocking on 2007/4/25 22:38:49

by nachenko on 2007/4/25 17:24:16
Thank you much....

Will do it now, hopefully with better results.
Didn't forget... just didn't know. (still don't)
that will be my next ???

(Once I apply it then the next time I will know.)
Again, thanks...

BlueStocking
Re: Embedding PHP code in theme template?
by nachenko on 2007/4/25 22:24:16

PHP inside Smarty:

<{php}>
...
<{/php}>
Use it on a theme file or block template, whatever you need.

Also, there are PHP custom blocks


For the last question, just capture the module name and insert the code. Suppose you want to insert a link in main menu after a module called "my pictures":

Quote:

<!-- start module menu loop -->
<{foreach item=module from=$block.modules}>
<a class="menuMain" href="<{$xoops_url}>/modules/<{$module.directory}>/"><{$module.name}></a>

<{if $module.name == "my pictures" }>
... insert your link here ...
<{/if}>

foreach loop for submenus here .........
<{/foreach}>
<!-- end module menu loop -->


The link will appear right after the link to "my pictures". Remember to add class "menuMain" to the link, just like in your own code (you forgot to do it in your example code):

Quote:
...
<a class="menuMain" href="<{$xoops_url}>/modules/<{$module.directory}>/">...
Re: Embedding PHP code in theme template?
by Sophie2 on 2007/4/25 22:23:40

Quote:
Is there something like [php]mycode[/php]?


<{php}>
include('yourcode.php');
<{/php}>
Re: Embedding PHP code in theme template?
by BlueStocking on 2007/4/25 22:05:47

Along the same lines I have another programing related question:

I want to make another menu item on the main menu -- without having to install a block to do it.

le="color: #000000"><?php ADMIN | MAIN MENU | EDIT TEMPLATE <table cellspacing="0"> <tr> <td id="mainmenu"> <a class="menuTop" href="<{$xoops_url}>/"><{$block.lang_home}></a> [color=990000]<a href="http://upnrunnin.hypermart.net/index.html">page 2</a> [/color]<!-- start module menu loop --> <{foreach item=module from=$block.modules}> <a class="menuMain" href="<{$xoops_url}>/modules/<{$module.directory}>/"><{$module.name}></a> <{foreach item=sublink from=$module.sublinks}> <a class="menuSub" href="<{$sublink.url}>"><{$sublink.name}></a> <{/foreach}> <{/foreach}> <!-- end module menu loop --> </td> </tr> </table>

***********************************************

I have inserted the Link to desired page using html... but it doesn't display in the menu area -- I haven't figured out why


It is satisfactory in block view.
http://upnrunnin.hypermart.net/xoops01/

EDIT ADDON:
THIS WORKED.... I missed it HAD TO BE A CLONE TEMPLATE.
________________________

1. You need to create a template set to work on(you can not work on 'default' template set). If you done that, igore the rest of this point. So go to admin part of XOOPS and System admin -> Templates. Then chose "clone", enter the name of new template set and click "Submit".

Next you need to tell XOOPS to use this template set. So go to System Admin -> Preferences -> General Setings and for "Default template set" option chose the new template set you created, scroll down and click "Go!"

2. Now you need to edit the template for main menu: Go to System Admin -> Templates and from the section of the new template click on list next to System (System [List (27)]). Find "system_block_mainmenu.html" and click edit. You should see something like this: The EXAMPLE ABOVE.

Who's Online

190 user(s) are online (146 user(s) are browsing Support Forums)


Members: 0


Guests: 190


more...

Donat-O-Meter

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

Latest GitHub Commits