Two lines Menu Item?
Support desk for Villa Belluci Joomla Hotel Template
- GK User
- Tue Oct 25, 2016 9:23 pm
Is possible to split/break long menu items in two lines? How is the procedure?
-
- Fresh Boarder
- teitbite
- Fri Oct 28, 2016 2:00 pm
Hi
That would require some extra scripting. I believe I posted something like that on forum already. Try this in /layout/blocks/head.php
That would require some extra scripting. I believe I posted something like that on forum already. Try this in /layout/blocks/head.php
- Code: Select all
<script type="text/javascript">(function($) {$(document).ready(function() {
$('#gkPageTop .gkMenu > ul > li > a').each(function(){
var elem = '';
var words = $(this).html().split(' ');
$.each(words, function( index, value ) {
//alert( index + ": " + value );
elem += value;
if(index==0) {
elem += '<br />';
} else {
elem += ' ';
}
});
$(this).html( elem.trim() );
});
});})(jQuery)</script>
-
- Moderator
- GK User
- Sun Oct 30, 2016 11:06 pm
Hello Teitbite,
Yes I found similar subject but like this code, is not working. I was thinking maybe is because is different template? Is given me this error code at the home page:
(...= any line I paste the code)
Thanks anyway, I hope you find the answer, it will be really useful,
Yes I found similar subject but like this code, is not working. I was thinking maybe is because is different template? Is given me this error code at the home page:
- Code: Select all
Parse error: syntax error, unexpected '<' in /home/javiervenue/public_html/templates/gk_hotel/layouts/blocks/head.php on line ...
(...= any line I paste the code)
Thanks anyway, I hope you find the answer, it will be really useful,
teitbite wrote:Hi
That would require some extra scripting. I believe I posted something like that on forum already. Try this in /layout/blocks/head.php
- Code: Select all
<script type="text/javascript">(function($) {$(document).ready(function() {
$('#gkPageTop .gkMenu > ul > li > a').each(function(){
var elem = '';
var words = $(this).html().split(' ');
$.each(words, function( index, value ) {
//alert( index + ": " + value );
elem += value;
if(index==0) {
elem += '<br />';
} else {
elem += ' ';
}
});
$(this).html( elem.trim() );
});
});})(jQuery)</script>
-
- Fresh Boarder
- teitbite
- Wed Nov 02, 2016 9:27 am
Hi
The error You've shown me means that You have copied the code between "<?php ?>" tags which is reserver for PHP code only. I piece of code I gave You is javascript and it has to be copied after "?>" tag.
The error You've shown me means that You have copied the code between "<?php ?>" tags which is reserver for PHP code only. I piece of code I gave You is javascript and it has to be copied after "?>" tag.
-
- Moderator
4 posts
• Page 1 of 1