Hi
@paul after studying the developers course at
https://www.udemy.com/discover I found the solution to my problem.
( I am running in developer mode and empty my cache manually to make sure on my server )
One of the problems I had was this section
template=$template
in my case
template=$index_list_fmradio.tpl
DIDN'T WORK
it should have been
template="index_list_fmradio.tpl"
I have written up a short tute for myself I thought I would share.
Let me know if there is something wrong with this but it works here
Creating an Aparna Module in JR
fmRadio and Radio are terms I used to create this module
Open
Aparna in the
ACP under the
Tools side menu
Clone the Aparna Module
Make sure you use a
UNIQUE 2 letter prefix when naming your module
eg.
fmRadio
( "fm" is your prefix to make it unique. Radio is your module)
After it is cloned click Cancel
RUN AN INTEGRITY CHECK...."RIGHT NOW"
Doing so will make sure everything is working ok
Now you will see your new created module under the "
TOOLS" side menu
Click on it and make it active under the "
INFO" tab
*This will then create a tab on your profile page to access your new module call RADIO
Set your quotas through the global config of the module to make sure who are allowed to use it.
eg. Artists to use it on their profile
*The quotas can be done at anytime if you are developing
Create all your fields in your module
*Create them through the form designer by accessing your module through YOUR profile, Click on the RADIO TAB and click on Form Designer
Once they are all created take note of the fields in the middle columns
ie. ModuleName_YourField
which for this tute equates to
eg.
radio_station
Below are some other fields you may have included which I will use in this example tute
radio_title (Default Created Aparna Field )
radio_station
radio_name
radio_address
radio_description
Once you are happy with your fields you want to bring into somewhere on your site, you need to style all the CREATED templates that were created through Aparna.
*Not doing so will bring in the fields eg. radio_station so you need to allocate each field
Open your module directory on your server ( modules/fmRadio/templates ) and edit the below tpl files
( These tpl files are created by Aparna )
item_action.tpl
item_detail.tpl
item_index.tpl
item_list.tpl
item_search.tpl
These are GENERIC tpl files created by Aparna
Edit them to suit your purpose
*An Example edit is below but you can style and call however the way you want
This is an example edit of the
item_list.tpl in your new module/template directory
{jrCore_module_url module="fmRadio" assign="murl"}
{if isset($_items)}
{foreach from=$_items item="item"}
<div class="item">
<div class="block_config">
{jrCore_item_update_button module="fmRadio" profile_id=$item._profile_id item_id=$item._item_id}
{jrCore_item_delete_button module="fmRadio" profile_id=$item._profile_id item_id=$item._item_id}
</div>
<h2><a href="{$jamroom_url}/{$item.profile_url}/{$murl}/{$item._item_id}/{$item.radio_title_url}">{$item.radio_title}</a></h2>
<br>
<!--EDITED FIELDS ARE BELOW-->
Radio Station: {$item.radio_station}<br>
Radio Name: {$item.radio_name}<br>
Address: {$item.radio_address}<br>
Description: {$item.description}
</div>
{/foreach}
{/if}
*If you aren't using translated languages you can do the above.
*If you are using translated languages you will have to set your languages via the ACP and add the relevant code to the above eg. add the lang string which I am not going to cover here
Do this in all your templates.
Add all the fields you created in each tpl file to style each file.
Your module will now show in your profile ( depending on quotas ) on a tab.
You can click on this after setting up one ie Radio Station etc and it will display the station/s.
How do I get this into my homepage?
This is what I asked which I worked out is quite easy
To display this information on the home page
STYLED the way you want it, you need to:
(You must do all of the above first otherwise your other pages will look wrong)
Create a new tpl file in your root template directory.
( yoursite/templates folder )
Call it what you want *eg. file name is :
index_list_fmradio.tpl
Now open your
item_list.tpl file in your module folder (
modules/fmRadio/templates ) and copy and paste the contents of this file into your new
index_list_fmradio.tpl file you created above
Edit this the way you want it looking on your home page and save it.
To Call The Template In:
Paste this wherever you want it in your index.tpl file in
skins/"YourSkin" directory
<!--fmRadio-->
{jrCore_list module="fmRadio" order_by="_created DESC" limit=1 template="index_list_fmradio.tpl"}
<!--END fmRadio-->
*The comments can be removed. They are only for coding purposes
Now your radio module will show up on your home page the way you styled it FOR YOUR HOME PAGE. ie. Has its own styling separate from the module pages.
--
~ https://punkbandpromotions.com ~
Check us out for all your Punk/Alternative Music!
Check us out on Facebook:- https://facebook.com/PunkBandPromotion
updated by @madc: 12/16/13 08:49:36AM