#1
|
|||
|
|||
![]()
Hi all,
Is it possible to add a button in Mosets? Thanks in advance! |
#2
|
|||
|
|||
![]()
So much specifics missing in the question.
- Is it for front or backend? - Do you want a form button or a standard hyperlink? - What exactly must happen when the button is used? |
#3
|
|||
|
|||
![]()
Hi Peter,
In the front and I would like a form button to link a photogalery (made with Ignite Gallery) and other expressive links. Thanks, |
#4
|
|||
|
|||
![]()
That seems like a standard Joomla menu item and not related to Mosets Tree. I have not used the ignite extension but if it is a component, create a menu item and select an appropriate type from the ignite elements
|
#5
|
|||
|
|||
![]()
That's a way, but I would like to direct them from the mosets tree lay-out directly.
So, is it possible to add a optional button (with a deep link) or is that not possible in Mosets tree? (see example) ![]() |
#6
|
|||
|
|||
![]()
The image certainly clarifies your inquiry.
There is no immediate setting to add such a button but it can be done with a template override. Step 1 While in Mosets tree admin - click templates in the left column - select the default template by checking the radio button - click copy template at the top - fill in the fields, specifically the first 2 fields - click save Step 2 - click the name of the template you created - if using version 3.6.x, in the right column click sub_listingDetailsActions.tpl.php if using a lower version, click sub_listingDetails.tpl.php and scroll to the bottom to see the actions code block. - add the following to the list Code:
$this->plugin( 'ahref','ADD-URL-TO-GALLERY-HERE', 'Gallery', 'class="btn"' ); Code:
<?php if( $this->show_actions_rating_fav ) { ?> <div class="row-fluid"> <div class="span12 actions-rating-fav"> <?php if( $this->show_actions ) { ?> <div class="actions"> <?php $this->plugin( 'ahrefreview', $this->link, array("class"=>"btn", "rel"=>"nofollow") ); $this->plugin( 'ahrefrecommend', $this->link, array("class"=>"btn", "rel"=>"nofollow") ); $this->plugin( 'ahrefprint', $this->link, array("class"=>"btn", "rel"=>"nofollow") ); $this->plugin( 'ahrefcontact', $this->link, array("class"=>"btn", "rel"=>"nofollow") ); $this->plugin( 'ahrefvisit', $this->link, '', 1, array("class"=>"btn", "rel"=>"nofollow") ); $this->plugin( 'ahrefreport', $this->link, array("class"=>"btn", "rel"=>"nofollow") ); $this->plugin( 'ahrefclaim', $this->link, array("class"=>"btn", "rel"=>"nofollow") ); $this->plugin( 'ahrefownerlisting', $this->link, array("class"=>"btn") ); $this->plugin( 'ahrefmap', $this->link, array("class"=>"btn", "rel"=>"nofollow") ); $this->plugin( 'ahref','ADD-URL-TO-GALLERY-HERE', 'Gallery', 'class="btn"' ); ?> </div> </div> </div><?php } } - set the new template as default I have setup a demo of the gallery button. See http://directory.websitedons.net/blo...dr-harvey-karp Last edited by peterwalker; 08-18-2015 at 08:23 PM. |
#7
|
|||
|
|||
![]()
Thanks a million!! That will do I hope. I'll let you know/show you the result.
Thanks again!! |
#8
|
|||
|
|||
![]() ![]() WORKS!! Only, the gallery button is now used in all listings. I can't change the gallery per listing so to speak. Listing 1 has an specific gallery Listing 2 has an other gallery and so on... Is this also possible in coding? Last edited by boioskam; 08-18-2015 at 09:23 PM. |
#9
|
|||
|
|||
![]()
Yes you can configure the code to show the gallery button on selected listings.
- create a custom field type as radio button. - give it an appropriate caption such as 'show gallery button' - enter the choices such as yes|no - assign the field to the categories desired - set show in details view to 'yes' - Note the field ID as it will be used later - edit the same file as before sub_listingDetailsActions.tpl.php as the following Code:
if( $this->fields->getFieldById(49)->value == 'yes' ) $this->plugin( 'ahref','ADD-URL-TO-GALLERY-HERE', 'Gallery', 'class="btn"' ); The caveat because show in details view is set to yes, the field value will display in your listing's field items, so additional file edit must be done. While in view of the override template settings - click the file sub_listingDetailsFields.tpl.php - find the line Code:
!in_array($field->getId(),array(5,6,7,8)) -------[ UPDATE ]----- After re-reading the quest, I realized the solution given is not what you asked, but usable anyway, so I'll leave it. To have a different gallery URL per listing - create a custom field type as text - add caption, set to show in detail view, assign to categories, note ID - no need to change any parameters in the right column - edit the same file sub_listingDetailsActions.tpl.php Code:
$gallery=''; if( $this->fields->getFieldById(49)->hasValue() ) { $gallery = $this->fields->getFieldById(49)->value; $this->plugin( 'ahref', $gallery, 'Gallery', 'class="btn"' ); } You can see it working at http://directory.websitedons.net/blogs . The first 2 listings have different destinations for the gallery button and the third listing has no button because the custom field was left empty. Last edited by peterwalker; 08-19-2015 at 01:09 PM. |
#10
|
|||
|
|||
![]()
Hi Peter, sorry for the late response, but I cant find the 'ub_listingDetailsActions.tpl.php' So I must be using an older version. Is that an older version Mosets Tree or older version kinabalu?
And I can't figure out where to put the last code ($gallery='';...) in the php file. Thanks again! |
#11
|
|||
|
|||
![]()
The new file to edit is sub_listingDetailsFields.tpl.php
sub_listingDetailsActions.tpl.php is the file you edited before to add the button. The $gallery=''; variable along with the conditional coding goes in place of the original edit you did to add the button. So the file will now look like this Code:
<?php if( $this->show_actions_rating_fav ) { ?> <div class="row-fluid"> <div class="span12 actions-rating-fav"> <?php if( $this->show_actions ) { ?> <div class="actions"> <?php $this->plugin( 'ahrefreview', $this->link, array("class"=>"btn", "rel"=>"nofollow") ); $this->plugin( 'ahrefrecommend', $this->link, array("class"=>"btn", "rel"=>"nofollow") ); $this->plugin( 'ahrefprint', $this->link, array("class"=>"btn", "rel"=>"nofollow") ); $this->plugin( 'ahrefcontact', $this->link, array("class"=>"btn", "rel"=>"nofollow") ); $this->plugin( 'ahrefvisit', $this->link, '', 1, array("class"=>"btn", "rel"=>"nofollow") ); $this->plugin( 'ahrefreport', $this->link, array("class"=>"btn", "rel"=>"nofollow") ); $this->plugin( 'ahrefclaim', $this->link, array("class"=>"btn", "rel"=>"nofollow") ); $this->plugin( 'ahrefownerlisting', $this->link, array("class"=>"btn") ); $this->plugin( 'ahrefmap', $this->link, array("class"=>"btn", "rel"=>"nofollow") ); // MODIFICATION TO INSERT GALLERY BUTTON $gallery=''; if( $this->fields->getFieldById(49)->hasValue() ) { $gallery = $this->fields->getFieldById(49)->value; $this->plugin( 'ahref', $gallery, 'Gallery', 'class="btn"' ); } ?> </div> </div> </div><?php } } |
#12
|
|||
|
|||
![]()
Thanks, works like charm!!
Can I pull this trick more times, to create more buttons, or is it just a once edditing of the php file? |
#13
|
|||
|
|||
![]()
yes you can apply the method to add as many action links as needed.
It is possible to add a function that would simplify the process if you expect to add many buttons. It would use a markdown method and a foreach loop. To give an idea without the actual coding 'cos it is a bit complex You would change the custom field to a multi-line text area Then when adding a listing and need to add buttons you would enter them in the following format Gallery|site/gallery --- Booking|site/booking --- Videos|site/videos The first part in each line separated by a vertical bar is the button label and the second is the URL. Then to add another button, you separate with 3 hyphens and repeat. |
#14
|
|||
|
|||
![]()
Hi, Peter
Other issue, when I switch to another 'listing style' the button disappears (see screenshots) ![]() ![]() How's that possible? I would like to use style 6, that's the last one, but than with button... Sorry again for asking.. |
#15
|
|||
|
|||
![]()
Nobody?
Probably due to the upgrade, the button I created are now gone. How do I get them back again? When I look at the code, it has ben simplified extreem, so I don't know what to do now... Please help! Last edited by boioskam; 04-11-2016 at 06:35 PM. |
#16
|
|||
|
|||
![]()
I figured out how to activate the button again, but I want to not show the link in the Listing Details
![]() When I simply switch of 'Detail View' the whole page get scrambled and an php error is visible. ![]() Please help?! |
#17
|
|||
|
|||
![]()
Why don't I get support???
That's not the Mosets way ![]() |
#18
|
|||
|
|||
![]()
Hi!
If you're using 3.6 and above, edit the following template file: /components/com_mtree/templates/kinabalu/sub_listingDetailsFields.tpl.php In line 4, you'll see: PHP Code:
|
#19
|
|||
|
|||
![]()
Thanks!!
Sorry for my bold reaction... Now we are on 'speaking terms' again, is there a way I can share buttons (like LinkedIn and Google+) from the listing overview site? Thanks!! |
#20
|
|||
|
|||
![]()
No problem. By 'listing overview' I suppose you mean listing summary?
|
#21
|
|||
|
|||
![]()
Ah back again
![]() I found the share section in the new template, thanks. New template, new possibilities, sorry for not looking properly... |
![]() |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Add download button at top of details page. | angelaroberts | Discussions, Troubleshooting & Problems | 5 | 02-24-2011 06:23 AM |
Backend 'Add Photo' button for Add Property does not work | randy | Discussions, Troubleshooting and Problems | 8 | 03-12-2010 12:56 AM |