Tagged: metabox fields, metaboxes, reuse metaboxes, wordpress error, workflow
- This topic has 4 replies, 2 voices, and was last updated 5 years, 8 months ago by
Steve.
-
AuthorPosts
-
-
May 18, 2016 at 7:08 am #6512
semwangajoshuaMemberThis is a long post but I kindly ask you to bear with me. I don’t want to use Piklist the wrong way just because I can use it to get what I want. I ran into this challenge when trying to reuse metaboxes on different page templates. I have a page template that uses a number of Piklist’s metaboxes. In my second page template, I would want to reuse some of those metaboxes I used on the first page template but not all of them. Why think this way? Because WordPress only shows data created by a metabox if the page being viewed is the same as the one on which the data was posted by those same metboxes. So reusing metaboxes is ok. However, when crating my second page template, I thought that if I added a coma between the values taken by the Template parameter in the comment block, like this Template: page-home, page-home-one, that would allow me rule out explicitly which template had to show those metaboxes. This way I’d specify which metaboxs could show on my second page template. This didn’t work however. I tried effecting the Hide for Template parameter step by step as specified in the documentation but this didn’t work either. I wanted to use/show my metaboxes on more than one template but failed. I wonder how I can do this? To try solve the challenge, I decided to create completely different metaboxes for use with the second page template since in the very metaboxes that I had earlier, I didn’t intend to use all of the fields therein on the second template; and so creating different ones seemed the way to go. I also thought that instead of creating new fields for use by the second template by simply adding them into the metaboxes I already have, that would make even the fields I don’t want to use show up on the second template or the first. So I created different ones. However, this has given me some headache as of now. Why? The metaboxes are not posting any data I enter in them neither does their data show on the frontend. I’m working with quite many variables for my site functionality and it seems WordPress is not happy about it. It throws this error:
Warning: Unknown: Input variables exceeded 1000. To increase the limit change max_input_vars in php.ini. in Unknown on line 0 Fatal error: Maximum execution time of 30 seconds exceeded in C:\xampp\htdocs\lawyeah\wp-includes\wp-db.php on line 1803I’m not much worried about the errors above, but I wonder how Piklist can help me work around them effectively while helping me implement the functionality I desire. So here are my questions to get them straight:
1. Is there a way to use a metabox on more than one page template while not showing it on all the pages by default like it’s the case when you don’t specify the Template parameter values? If yes, how?
2. If it is possible to reuse metaboxes on different page templates, is there a way to hide desired fields of a metabox from showing in the metabox if it is being used on another page template?
3. Is my approach of creating different metaboxes for use with a second template ok? Isn’t it the chief contributor to the max_input_vars limit hit error? If my approach of creating different metaboxes for a second template is ok, do you think it’s ok to increase the max_input_vars parameter value or it’s not advisable? -
May 19, 2016 at 10:29 pm #6517
SteveKeymasterOur latest beta supports multiple page templates via the
Templateparameter. -
May 20, 2016 at 6:59 am #6520
semwangajoshuaMemberThanks Steve. Let me give it a shot and see how things turn out. Thanks.
-
May 20, 2016 at 8:04 am #6522
semwangajoshuaMemberI’ve actually upgraded to the latest version of Piklist but still it doesn’t seem to work.I’ve tried this:
Template: 'page-home','page-home-one'and this:Template: page-home, page-home-onein the comment block but I don’t see a change in behavior. May be you could help me and show me how the implementation is done since the documentation now has references to the old way of working about the issues. -
May 20, 2016 at 10:18 am #6523
SteveKeymasterSo, Template: page-homeworks, butTemplate: page-home, page-home-onedoes not? Or they both don’t work?
-
-
AuthorPosts
- You must be logged in to reply to this topic.