Link field work and improvements #6613
Replies: 42 comments
-
We are not adding any new features to Pods 2.X. Once we finish the cmb2 integration for Pods 3.0 we can address new field types. This would be one be very nice to have, possibly as a specific type of loop field. |
Beta Was this translation helpful? Give feedback.
-
Is there a guide/howto on creating extra field types? I would like to try and start with this field on the 3.0 release. |
Beta Was this translation helpful? Give feedback.
-
If you can start with building the frontend for it and how it would work / look (using the same aesthetics as WP), I can meet you in the middle and help you adjust the current website field to support this field format. |
Beta Was this translation helpful? Give feedback.
-
Hi Scott, I assume you mean wireframes and a HTML version of the a link.php template (ui/fields/link.php)? |
Beta Was this translation helpful? Give feedback.
-
Yes, I'd like to see some frontend markup and styling for how you envision it looking. |
Beta Was this translation helpful? Give feedback.
-
This is how I would see this working. Especially the popup feature would be neat. HTML version for the file link.php in ui/fields: <div id="link-options">
<p class="howto"><?php _e('Enter the destination URL') ?></p>
<div class="alignleft">
<label><span><?php _e('URL') ?></span><input id="url-field" type="text" name="href"></label>
</div>
<div class="alignleft">
<label><span><?php _e('Title') ?></span><input id="link-title-field" type="text" name="linktitle"></label>
</div>
<div class="link-target">
<label><div> </div><input type="checkbox" id="link-target-checkbox" style="display: inline-block;"> <?php _e('Open link in a new window/tab') ?></label>
</div>
<p class="howto" style="clear: both;"><a href="#" id="wp-link-search-toggle"><?php _e('Or link to existing content') ?></a> (Popup WYSIWYG Link feature & autofill above fields)</p>
</div> |
Beta Was this translation helpful? Give feedback.
-
I've searched some extra info on the WYSIWYG link feature. Is done with a javascript class (wp-includes / js / wplink.js) and i'm afraid its build for the editor only. We could use this as a blueprint for this field... |
Beta Was this translation helpful? Give feedback.
-
An class on this feature: wp-includes / class-wp-editor.php lines:
|
Beta Was this translation helpful? Give feedback.
-
Great research here, would love to find ways to integrate into the link to existing and figure out how to utilize all of this on non post editor areas like user edit / taxonomy term add/edit, or even on the frontend of a site. |
Beta Was this translation helpful? Give feedback.
-
UI of the field looks great to me by the way |
Beta Was this translation helpful? Give feedback.
-
+1 looks good |
Beta Was this translation helpful? Give feedback.
-
Just wondering how this one was progressing as I have a need for it. |
Beta Was this translation helpful? Give feedback.
-
It doesn't have a contributor yet as I can see so far. Scott, I would like to help in the development on this though I think I will need some help from a Pods developer. |
Beta Was this translation helpful? Give feedback.
-
Also, here is a plugin for ACF witch does a simpler version of what we want to do: |
Beta Was this translation helpful? Give feedback.
-
That is exactly how it should look, no point reinventing the wheel. |
Beta Was this translation helpful? Give feedback.
-
@JoryHogeveen sorry for not getting back to you. Do you want to tackle these things in 2.7 or can we push them to later? |
Beta Was this translation helpful? Give feedback.
-
@sc0ttkclark I'd like to tackle these for 2.7 since I believe it will raise a lot of support questions otherwise. The first item is about making some fields compatible with eachother when switching. The last topic is your area so I'll leave that up to you. |
Beta Was this translation helpful? Give feedback.
-
Never actually tested this one, sorry. Output isn't correct in a Magic Tag (ie we should just be able to go this is what it outputs: I think because it's actually built as an array, it output it as a display() list, so url, text, and target. It should actually construct the link. |
Beta Was this translation helpful? Give feedback.
-
ie, it should have a special handler for display() like your output as gallery option. |
Beta Was this translation helpful? Give feedback.
-
While this is a neat idea it might lead to confused users - just adding a field should I use link or Website? whats the difference? In my opinion this two fields need to be combined and act like the image stuff to be consistent!
@sc0ttkclark @JoryHogeveen - do you want another issue? for the time being I just reopened this one! |
Beta Was this translation helpful? Give feedback.
-
I think you're right, we need to differentiate these two field types much better in describing/naming them. As far as combining them, there's some technical issues to overcome, one is a text input and the other has a few different parts to it. Magic tag / display support could probably be improved too, I'm open to potentially putting this new field type inclusion on hold until we get the naming thing sorted out. We could comment out the |
Beta Was this translation helpful? Give feedback.
-
At least until the output for dispaly and magic tags works correctly we should not put it out in the wild - i like the new approach and i would see it as a superior solution - maybe we can convert the old field to it and add a option in the configuration? something similar to how images work or we add another group of "URL" Kind of fields ... @reachadam from WPCrafter already asked me about the weird output ;) |
Beta Was this translation helpful? Give feedback.
-
Let me know if you have any ideas for combining these fields. With these changes I think renaming the Website field is mandatory since I don't think it described exactly what is done here. |
Beta Was this translation helpful? Give feedback.
-
My thought would be if you checked the 'link' button, that's when the additional options would show up because then they would be needed. Typically the website field would be designed to contain the URL portion of the 'link'. I've always felt the Website field is actually a URL field. I use it for that with YouTube links, Slideshare, etc. The old 'link' post type that was part of WordPress was designed more like you've set this one up to be. If we were to combine them, the other options should only show if you want the 'link' to be handled automatically with |
Beta Was this translation helpful? Give feedback.
-
Idea / Summary:
maybe not the best approach but seems inline with the current options for files / images / and it should work for "old" and "new" thoughts? |
Beta Was this translation helpful? Give feedback.
-
Is this still planned to make 2.7? |
Beta Was this translation helpful? Give feedback.
-
Do we have a list of todos left on this or are the remaining things left just nice-to-haves? Should we punt to 2.8? |
Beta Was this translation helpful? Give feedback.
-
I think we'll need to clearify what to do exactly first before we can create a todo list. |
Beta Was this translation helpful? Give feedback.
-
New request/vote for this field: https://wordpress.org/support/topic/custom-fields-to-store-link-and-its-description/ |
Beta Was this translation helpful? Give feedback.
-
Another user requesting the same feature: https://wordpress.org/support/topic/website-repeatable-title/ |
Beta Was this translation helpful? Give feedback.
-
Is it possible to add a Link field to Pods?
Would be a bit similar to a Website field I think.
Could be separate metadata in the database or a serialized array.
Last items for Pods 2.7 #4068
See: https://github.com/JoryHogeveen/pods-link-field/blob/master/classes/fields/link.php#L252-L255
See: JoryHogeveen/pods-link-field@5a07ddd
Beta Was this translation helpful? Give feedback.
All reactions