Osclass forums
Support forums => Tips, tricks, and tutorials => Topic started by: mmcsus on May 07, 2013, 12:35:37 am
-
Find attached gallery_main.php
Rename your oc-content/themes/bender/main.php to something else.
Rename this attachment to main.php and save to --> oc-content/themes/bender.
Note: This is for "Bender" theme, not for bender_red or bender_purple or ... etc.
... end.
#############################################
If you want to set gallery view to default in "main", "search" and "user dashboard" forget the above and do this:
Paste the following code to the end of your oc-content/themes/your_bender/js/global.js
$(document).ready(function(){
$('.grid-button').click();
});
This works in all bender themes.
... end.
-
.
Hi mmcsus . . .
1.)
>>to main.php and save to your theme . . . . . .
Sorry to say it, - but it does not work in.: bender_red :(
- -
2.)
OnLine error message:
* Fatal error: Call to undefined function bender_add_boddy_class() in /home/XXXXXXXXXX/domains/XXXXXXXXXX.dk/public_html/s51/oc-content/themes/bender_red/main.php on line 25
and no-no-nanette -it was not the stereo boddy :P
- -
Best Regards.:/ s51
.
-
Hi s51,
Yes, I should have put a note to reflect that.
You can add code to the other colors like so:
In the attachment above find around line 38:
<a href="<?php echo osc_update_search_url(array('sShowAs'=> 'gallery')); ?>" id="dgallery" class="grid-button" data-class-toggle="listing-grid" data-destination="#listing- ...
In your bender color add --> id="dgallery"
At the end of your bender color main.php add the following: (Use above attachment as guide)
<script type="text/javascript">
$(document).ready(function(){
$('#dgallery').click();
});
</script>
Just so other members know, this is telling jQuery to push the gallery button after the page loads.
-
OnLine error message:
* Fatal error: Call to undefined function bender_add_boddy_class() in /home/XXXXXXXXXX/domains/XXXXXXXXXX.dk/public_html/s51/oc-content/themes/bender_red/main.php on line 25
and no-no-nanette -it was not the stereo boddy :P
The reason you got this error is because in each of the bender themes they use different function names so the function for the bender red theme should be bender_red_add_boddy_class() on line 25 of the min.php file.
Jay
-
.
Hi u2 Usa,ske gentlemen.: mmcsus and Trains58554
1.)
Yep - this time it keep responsivity in both Iphone & Ipad = deluXe 8)
and in the main page it now start up in = gallery mode
- -
2.)
But mmcsus can you also find the next.: jQuery push to gallery button ?
why,,,
because in the search page, it still start up in the list mode,
it should also be gallery mode. THANKS in advance
- -
3.)
Holy cow,,, these style sheets are not too tired old men (my time is now 02:17)
And Trains58554 I might have misunderstood
>>should be bender_red_add_boddy_class() = any case I can not get it to work ?
- -
Best Regards.:/ s51
.
-
Hi s51,
If you want to set gallery view to default in main, search and user dashboard forget the above and do this:
Paste the following code to the end of your oc-content/themes/your_bender/js/global.js
$(document).ready(function(){
$('.grid-button').click();
});
This works in all bender themes.
-
Thank you, mmcsus! But, when the page load in search bar of the browser appear this : http://MY_SITE/search/sShowAs,gallery/ ... How to remove this, to be only http://MY_SITE.com..
Regards!
-
.
Hi mmcsus . . . and Madboy92 & trains58554 ...
1.)
>>search/sShowAs,gallery/
Exactly,,, unfortunately
This also applies to search engines, who now see the address as: \www.bla.bls.\dk\search\sShowAs,gallery\
and users who which stores the address in their browser favorites: \www.bla.bls.\dk\search\sShowAs,gallery\
- -
2.)
* But now to the weird stuff
Have any of you noticed, - it only happens in newer browsers ?
On my inhouse server Fujitsu Siemens Celsius born with XP proff. and IE8
everything is displayed correctly ! (both OffLine and OnLine)
Yes and ..ALSO.. the category view in main page moving up nicely aligned under each other,
and ..ALSO.. with mmcsus js code inserted, the browser address showing correct,
- -
3.)
On our other ,,inhouse,, PC,s a: small 11" with G.Chrome and a 16" with IE (shift) 9 between 10
they all fail, - showing main categories etc. wrong, - and mmcsus,s insert JS as: \search\sShowAs,gallery\
on Iphone4s and Ipad 3g horizontal and vertical tilt works perfectly - and grid show is much better i handhelds,
But:
Unfortunately the Apple gadgets also fails, with regard to browsing adress. as: \search\sShowAs,gallery\
- -
4.)
mmcsus like you I have through trawlet Chris Coyer,s page in a flimsy hope of finding precedents,
I,m not a coder, - but I __think__ it's about ,,old,, core code, - that will not work with the new responsive code ?
*
Regardless all of the above, - I still believe firmly in responsive code, - as code for the tomorrow future, - there is no other way. ;)
- -
Best Regards to you all.: / s51
.
-
i just found, that when i load my site from google, it`s only domain without >>search/sShowAs,gallery/... We must remove this code, to load only domain. But How?!
-
To add the script part in the js file is not a good solution because it will lead directly to the search page.
there has to be a better solution for only grid mode and staying on the page where you are at that moment.
EDIT:
see my next topic on this same subject for allround solution.
-
In main.php, just change this:
<ul class="listing-card-list" id="listing-card-list">
to this:
<ul class="listing-grid" id="listing-card-list">
/*to get the starting grid list mode */
in main.css add this line (where all the listing classes are):
.listing-grid {clear: both}
/* this is to keep the h1 and action button on it's own line */
Now for who clicks the button to go to table mode you will notice in the url it will lead you to the search page.
If you would like it to stay on the main page, you should change the url. Look after this part: <span class="doublebutton
etc. of the main.php page, and change the parts that says (there are 2):
<?php echo osc_update_search_url
to:
<?php echo osc_base_url
. /*with index.php in browser adres bar*/
or:
<?php echo osc_base_url($with_index = false)
/* without index.php in browser adres bar */
then I addded this code to the bottom of global.js:
$(document).ready(function(){
$('.grid-button').click();
});
So that the button appears to be active on gridmode.
Of course (because of the js part) you only have to change the main.php (to keep it from going to th search page) because any other page (search page) automatically responds to the added js part.
Hope this helps people.
-
hello mmcsus
can i use this gallary on modern theme at seach.php? kindly reply
-
@ Legion
No, I don't think so at least without a lot of work.
-
In main.php, just change this:
<ul class="listing-card-list" id="listing-card-list">
to this:
<ul class="listing-grid" id="listing-card-list">
/*to get the starting grid list mode */
in main.css add this line (where all the listing classes are):
.listing-grid {clear: both}
/* this is to keep the h1 and action button on it's own line */
Now for who clicks the button to go to table mode you will notice in the url it will lead you to the search page.
If you would like it to stay on the main page, you should change the url. Look after this part: <span class="doublebutton
etc. of the main.php page, and change the parts that says (there are 2):
<?php echo osc_update_search_url
to:
<?php echo osc_base_url
. /*with index.php in browser adres bar*/
or:
<?php echo osc_base_url($with_index = false)
/* without index.php in browser adres bar */
then I addded this code to the bottom of global.js:
$(document).ready(function(){
$('.grid-button').click();
});
So that the button appears to be active on gridmode.
Of course (because of the js part) you only have to change the main.php (to keep it from going to th search page) because any other page (search page) automatically responds to the added js part.
Hope this helps people.
doesnt seems to work good... I mean, when you enter the page the grid looks all messy.
-
well, what exactly did you do? because mine looks great!?
-
well, what exactly did you do? because mine looks great!?
I got all mad about so I decided to stay with the list view but I tweaked it to look a bit better... Add shadows and tooltips, I think I like better now. Check it out: http://web.mallpatagonia.cl/
Thanks anyway!
-
well, what exactly did you do? because mine looks great!?
I got all mad about so I decided to stay with the list view but I tweaked it to look a bit better... Add shadows and tooltips, I think I like better now. Check it out: http://web.mallpatagonia.cl/
Thanks anyway!
so I found the problem.... I DIDN'T change
<ul class="listing-card-list" id="listing-card-list">
to
<ul class="listing-grid" id="listing-card-list">
and now it works fine! :)
before it was looking like that:
(http://at.shareboxx.com/images/error.png)
... now it works! :)
greeeetz
-
Now for who clicks the button to go to table mode you will notice in the url it will lead you to the search page.
If you would like it to stay on the main page, you should change the url. Look after this part: <span class="doublebutton
etc. of the main.php page, and change the parts that says (there are 2):
<?php echo osc_update_search_url
to:
<?php echo osc_base_url
. /*with index.php in browser adres bar*/
or:
<?php echo osc_base_url($with_index = false)
/* without index.php in browser adres bar */
doesnt seems to work good... I mean, when you enter the page the grid looks all messy.
Thanks for this trick!
But when I change those 2
<?php osc_update_search_url
to
<?php echo osc_base_url($with_index = false)
I got server error...
<?php osc_base_url
Works OK but as said with *index.php in browser bar/url-field
I would be glad if I don't get *index.php in the browser url-bar/field...
Maybe I'm doing something wrong here?
-
stiffe, I think we replace
<a href="<?php echo osc_update_search_url(array('sShowAs'=> 'gallery')); ?>
with
<a href="<?php echo osc_base_url($with_index = false); ?>
NOT with
<a href="<?php echo osc_base_url($with_index = false)(array('sShowAs'=> 'gallery')); ?>
-
stiffe, I think we replace
<a href="<?php echo osc_update_search_url(array('sShowAs'=> 'gallery')); ?>
with
<a href="<?php echo osc_base_url($with_index = false); ?>
NOT with
<a href="<?php echo osc_base_url($with_index = false)(array('sShowAs'=> 'gallery')); ?>
Yes, you're right, I did miss that.
Works ok now.
Thank you for pointing it out.
-
When I go to my dashboard, though it's in gallery view but it's missing the pagination at the bottom.
I have to refresh the page to get the pagination. How do i solve this? thanks
-
sorry for disturb this thread. I post more easy solution, hope that can help
http://forums.osclass.org/themes/easy-way-to-set-default-as-gallery-for-all-pages-%28bender-theme%29
-
good evening
I take what the theme bender tutorial thank you
-
not working
-
Thanks for the tip :)
-
@mmcsus - Thanks for the tip.
;)