I’d like to know where I can change the default amount of articles that are displayed on an article list page. I do know how I can change it by passing a parameter in the URL, but I want to know how I can make Oxid use a value other than 10 articles if there is no such parameter.
found with google in 0.36 seconds…
I am working on a theme that doesn’t inherit from Azure though and I don’t have that setting. I realize that you can add theme settings somehow (btw is the wiki page on that topic still accurate?). I tried finding the location where this setting is used in the Azure theme for reference on how to use it, but I wasn’t successful.
Unfortunately, it seems 90% of the documentation (especially regarding themes and modules) is outdated or flat-out nonexistent. So most of the time, when I try solutions to problems people before me also had (or something I’ve read in the wiki), stuff breaks because it’s not vaild for the current version of oxid anymore.
I tried googling this question before asking of course. Maybe my keywords were bad or maybe personalized search hid the result you linked somewhere a lot of pages further away. In any case I didn’t find what you linked me. I got pretty much only source code documentation or completely unrelated results.
And even if I had found it, I still would have to ask where the theme setting is used in Azure to figure out where it actually takes effect and make use of the code for what I need to do.
If there was a good and up-to-date documentation about the themes and oxid in general I wouldn’t have to ask so much. But there is hardly any useful information at all. If there is, by all means, point me to it and I won’t need to bother you again (the info on the wiki, IF it is still valid, is simply not detailed enough and Azure doesn’t have ANY in-line documentation). Having to ask about evey little thing is no less annoying for me than it may be for you.
Sorry, I overreacted somewhat because an answer like that really pushes my buttons. Rephrased my post accordingly.
I have tried to track down the place where the theme config affects the amount of articles displayed by searching for the “getViewThemeParam” function. The search came up with exactly one file where it is used (start.tpl). But it only gets “sStartPageListDisplayType”, which is different from what I am looking for. Are there other ways to access theme configuration?
do you have a child theme or a custom template? child templates automatically inherit settings set for azure. In the other case, if you do not make use of this setting in your tempalte, you can hardcode some default values. its all up to you.
As I have stated already, it’s a custom one. And I can’t do what you suggested because even in the Azure theme, I cannot find the location where the setting is applied to use the code as a reference.
“Amount of displayed articles” is not used in template because the template just displays all articles it gets from the controller. Changing this number will affect paging etc. but in template all this is just displayed, calculation of paging etc, is done in controller and core.
So changing the theme setting for how many articles are supposed to be displayed actually changes the behavior of controller and core and not the theme itself (only indirectly)? That seems really counter-intuitive.
That would explain why I couldn’t find a single location in the theme files where this setting actually does anything.
Edit: Ok so I tried copying the theme setting from Azure and change it’s possible values from 10,20,50,100 to what I need (4, 8, 12, 16, …40), but it’s not as simple as I thought. I found the SQL insert hat puts that theme setting:
INSERT INTO `oxconfig` (`OXID`, `OXSHOPID`, `OXMODULE`, `OXVARNAME`, `OXVARTYPE`, `OXVARVALUE`) VALUES ('1545423fe8ce213a0435345552230295', 'oxbaseshop', 'theme:azure', 'aNrofCatArticles', 'arr', 0x4dbace2972e14bf2cbd3a9a4113b83ad1c8f7b704f710ba39fd1ecd29b438b41809712e316c6f4fdc92741f7876cc6fca127d78994e604dcc99519); INSERT INTO `oxconfigdisplay` (`OXID`, `OXCFGMODULE`, `OXCFGVARNAME`, `OXGROUPING`, `OXVARCONSTRAINT`, `OXPOS`) VALUES ('1545423fe8ce213a06.20230295', 'theme:azure', 'aNrofCatArticles', 'display', '', 23);
OXVALUE seems to be some sort of hex number. How can I modify it to have the numbers I want? (Of course I’ll have to change the id and oxmodule value before actually inserting that).
[QUOTE=Anpan;148297]So changing the theme setting for how many articles are supposed to be displayed actually changes the behavior of controller and core and not the theme itself (only indirectly)? That seems really counter-intuitive.[/QUOTE]
That’s MVC, paging logic is in the controller. To get the correct values i suggest to set the values you need in backend and then export them with phpmyadmin.
Thanks, that seems simple enough.
(Also I wasn’t questioning that the controller has to do paging. That makes sense. I was questioning the location of that setting because one would expect that theme settings are used in the theme, rather than somewhere in the business logic).
Yes that’s true, is think the idea is to have all settings there that can change when changing a theme.
they are also used in the theme. As leofonic said, you might want to display a different amount of articles and different sized pictures in other themes, e.g. the mobile theme.
Do you know about MVC? I mean the concept and meaning of this pattern and not just “model view controller”. Understanding how MVC works will help you a lot to understand the data flows in the shop.