Forum Replies Created
-
AuthorPosts
-
Beda Schmid
ParticipantHummmm...
Ok, here is what I found:
- If we just create a view and assign to The whole page layout, including header and footer, but do NOT insert a head tag, or do NOT call get_header, then the HTML source will be
<html><head></head><body>This would be the View content. Whatever we put here, code, HTML, Twig, etc etc.</body></html>
-
If we insert manually a head tag, it will replace the empty head tag, and produce what we insert in the View
-
If we call get_header, it also replaces the head tag, and puts in what comes from the theme
So far, so good, I misunderstood how it works, I think.
I thought the view would simply replace all content and not expect any head or else like a "completely blank output"I can proceed, it is clear now.
Thanks a lot, Long!
Beda Schmid
ParticipantI confirm that with a valid Google Maps API, the backend also works.
Interesting is, that the lat and long are saved as well without valid API Key but then the backend won't reflect the saved settings.
Issue's resolved for the Google Map field, but it persists in the OSM Map, but is resolved when we map a address field to it.
I guess with that we can close this ticket.
Thanks!
Beda Schmid
ParticipantHi, thanks!
I have shared the access details in the link/I also added explanation to the message how to find the issue.
I found that this is an issue that was mentioned once here already https://support.metabox.io/topic/map-field-not-working/Thanks!
Beda Schmid
ParticipantHello
Yes, I know that.But when you choose The whole page layout, including header and footer, then the result is a empty head tag, such as I explain in my firs post.
The result will be (in HTML source):
<html>
<head></head>
<body>
HERE WILL DISPLAY THE VIEW ASSIGNED TO The whole page layout, including header and footer
</body>
</html>As you can see head is empty
This is not good, as head should not be empty, or at least not insert by the plugin, so we could populate it on our own.
Note, this head tag is not coming from theme, it comes form View assigned to the page.Thanks!
Beda Schmid
ParticipantOK, I think I misunderstood the hint in the field
It works, if we indeed alter the value keys in the GUI.
Sorry the trouble, no issue at all here, can be closed...
Beda Schmid
ParticipantThe trick is to increase the array key.
Hence, the correct code is
'options' => [
'value' => esc_html__( 'https://the-million-posts--site.tukutoi.com/wp-content/uploads/2020/12/a79b4e0b-a842-300a-a503-8288e4e8603c.jpg', 'text-domain' ),
'value1' => esc_html__( 'https://the-million-posts--site.tukutoi.com/wp-content/uploads/2020/12/537f927b-2c14-3162-8a44-c0ac6c39fc8f.jpg', 'text-domain' ),
],
],
AIO does not do this, it seems.
Perhaps it is a bug?January 16, 2021 at 5:28 PM in reply to: ✅best solution to search in custom tables, and post relationships, and native wp #24055Beda Schmid
ParticipantExcellent thanks!
For anyone findings this - with WP Grid Builder (and probably all other plugins creating index) you can query these fields easily.
You just need to use the respective APIs to build the index, using the rwmb_get_value or rwmb_meta like in this example (for WP Grid Builder):
$row['facet_value'] = rwmb_meta( 'meta_field_slug', '', $object_id );This also works for the map field, as long we match the Facet plugin expectations when building the index.
This works for all kind of fields, since actually those indexes do not expect real existing data, we could even pass fake data to it.
Thanks!
Beda Schmid
ParticipantI found the "issue"
It actually saves the data, but in the backend, in the map, it defaults still to Dublin after saving.Is this expected?
I use only Metabox here.
January 14, 2021 at 12:45 PM in reply to: ✅best solution to search in custom tables, and post relationships, and native wp #24022Beda Schmid
ParticipantThat sounds great, thanks!
As for importing data, are there suggested ways to import content (like post and postmeta) but to Custom Tables?
Or would I have to custom code some importer in this case?Also I read in that other post, the Maps/Google field cannot be searched by FacetWP?
I will test this, but just asking in case things changed meanwhile.Thanks!
January 13, 2021 at 2:55 PM in reply to: ✅Overflow hidden on .menu-item-settings class makes certain settings undeletable #24014Beda Schmid
ParticipantSorry the delay
Indeed this is resolved, thanks!
December 26, 2020 at 9:13 PM in reply to: ✅Query args of Posts Field seems to fail when arrays are passed #23739Beda Schmid
ParticipantNice!
Didn’t see that, thanks Long!
December 26, 2020 at 6:05 PM in reply to: ✅Query args of Posts Field seems to fail when arrays are passed #23736Beda Schmid
ParticipantI was using the Builder (Backend UI).
Indeed I can see now why this is, after reading the code you sent, I see a difference.
The builder produces a code where the field query args array is a string:'query_args' => [ 'post__not_in' => 'array( 773 )', ],Instead, it should be
'query_args' => [ 'post__not_in' => array( 773 ), ],So when using the AIO Builder, it will not register arrays correctly, it always seems to assume string as input, and produce string in the arg, which might even produce issues when the arg expects a numeric value.
Perhaps this can be fixed in the builder, it would save time to edit code/save/reedit code etc
December 26, 2020 at 3:15 PM in reply to: ✅How to create a form with just a few fields of a Fields Group, without posting #23733Beda Schmid
ParticipantIn case anyone stumbles on the same issues, this is how I solved it:
- First form includes only a few fields visibly
- It has a Custom Redirect Hook applied that does two things: Redirect to a new URL and passes certain input values to the URL, as well it deletes the post just created, as we don't want it to be saved just yet
- On the redirect target the final full form will allow to complete the process, and is populated by the available url parameters.
The code:
For the redirect and delete post actions:add_filter( 'rwmb_frontend_redirect', 'my_redirect_custom_hook', 10,2); function my_redirect_custom_hook($url, $config){ if( $config['id'] == 'my-metabox-slug' && startsWith( $_POST['_wp_http_referer'] , '/referrer-base/' ) ){ $url = 'site.com/target/?url_param_one=' . $_POST['metabox-field-one'] . '&url_param_two=' . $_POST['metabox-field-two']; wp_delete_post( $config['post_id'], true ); } return $url; } //Helper Function since only PHP8 and above will support natively str_starts_with() function startsWith( $haystack, $needle ) { $length = strlen( $needle ); return substr( $haystack, 0, $length ) === $needle; }Then on the target page (final form), read the URL arguments with JS and put them in the determined fields:
jQuery( document ).ready(function($){ function querySt(ji) { hu = window.location.search.substring(1); gy = hu.split("&"); for (i=0;i<gy.length;i++) { ft = gy[i].split("="); if (ft[0] == ji) { return ft[1]; } } } var url_param_one = querySt("url_param_one"); var url_param_two = querySt("url_param_two"); document.getElementById('metabox_field_form_id_one').value = url_param_one; document.getElementById('metabox_field_form_id_two').value = url_param_two; });It will need some more care in sanitising the url params, and of course, change the slugs and ids to the specific use cases.
December 21, 2020 at 12:48 PM in reply to: ✅How to create a form with just a few fields of a Fields Group, without posting #23667Beda Schmid
ParticipantAh, forgot:
Is it possible to pass the values from first form to second form?Or, in other words, how’d go for populating form fields dynamically according a previously submitted form?
I read only the post ID can be set by url param.
However it must be possible somehow to populate other fields dynamically also?Thanks!
December 21, 2020 at 12:46 PM in reply to: ✅How to create a form with just a few fields of a Fields Group, without posting #23666Beda Schmid
ParticipantThanks Long for confirming!
I’ll use the hooks.
Regards, Beda
- If we just create a view and assign to The whole page layout, including header and footer, but do NOT insert a head tag, or do NOT call get_header, then the HTML source will be
-
AuthorPosts