WPLake
Forum Replies Created
-
Hi @laksacurry
We’re glad to hear it’s all working well.
To have the “Featured image with link”, you’d need to please update your ACF Views plugin to the latest version.
Hi @laksacurry
What you’d need to do is create an ACF View, we’ll call this View “archive item” in there you’d assign from Group $post, “Title with link”, and “Featured image with link” fields, with a small image size. Publish the View. (No need to copy shortcode here)
Then create an ACF Card, we’ll call it “archive grid”, assign your “archive item” View. Use filters as necessary, for e.g. so it shows “gallery archive CTP” post types items. Publish and copy the first shortcode, go to your “Galleries overview” page (the page that should show all archive items). Use the Gutenberg shortcode block or paste directly into the content. Publish the page.
For the Gallery page/post (gallery single) we’ll also create an ACF View, let’s call it “archive details” and then you can again assign the fields “Title”, “Featured image” with image size large (no need for links as we’ll be on the page) and keep adding all the other fields that need to be displayed. Save and copy the shortcode, paste it on the “gallery” page/post to test (but it would be worth while putting the shortcode in your theme’s template file). Fill the fields from your “archive item”. Save that and view the post to see the result. Remember to add some more gallery page/post items at this stage, if there aren’t any.
Visit the Gallery overview page and it should show the gallery single item, or more if there are available. Clicking on either the title or image would go to the details page.
Let me know if that works.
- This reply was modified 1 year, 8 months ago by WPLake.
Hi @dotnetdiva
Unfortunately the code you provided wouldn’t work, as it has syntax errors.
Please see below for a code snippet. You can use that as a base. See the “fixme” comment lines in the file, where you’d need to replace it with your values.
Kindly note that in the Database, only the value of the selected choice is stored (from the field settings). So, if your button?group has the selected choice as ‘base: Base’, you’ll need to compare exactly with ‘base’, but not with ‘Base’.
<?php // fixme use your field name in the quotes instead of 'base_game' $baseName = $_fields['base_game'] ?? ''; $baseDescription = ''; switch ($baseName) { // fixme use your target value in the quotes case 'base': // fixme use your target label in the quotes $baseDescription = 'Expansion'; break; } return [ 'baseDescription' => $baseDescription, ];
Forum: Plugins
In reply to: [Advanced Views - Display Posts, Custom Fields, and More] Query LoopNot a problem @carlbtmn
Forum: Plugins
In reply to: [Advanced Views - Display Posts, Custom Fields, and More] Query LoopThank you, I think I understand better now.
You’d need to create an ACF Card and assign your View. There are Sort and Filters available.
Please see our docs for more details.
Let me know if that helps.
Forum: Plugins
In reply to: [Advanced Views - Display Posts, Custom Fields, and More] Query LoopHi @carlbtmn
Only official ACF fields are currently supported.
Do you mean, you’re using ACF Views already but have an issue with same value for all? If so, try putting the shortcode in the post/page template.
Hi @justcarl,
The task isn’t ordinary, so you’ll need to use some of our filters.
I can suggest the following solution:- Add the $Post$ ‘Title’ field to your View (at the very top)
- Add the following code to your theme, that will do the trick, and replace the file’s name with the current post title
class FileWithPostTitle { private string $currentPostTitle = ''; public function __construct() { // fixme use your view id instead of '5' add_filter('acf_views/view/field_markup/view_id=5', [$this, 'maybeModifyMarkup',], 10, 4); } /** * @param \org\wplake\acf_views\AcfView\FieldMetaInterface $fieldMeta */ public function maybeModifyMarkup($fieldHTML, $fieldMeta, $fieldValue, $viewId): string { $name = $fieldMeta->getName(); switch ($name) { case '_post_title': $this->currentPostTitle = $fieldValue; $fieldHTML = ''; break; // fixme use your file field name instead of 'file' case 'file': // 1. replace the current link label with the stub $fieldHTML = preg_replace('/(<a[^>]+>)([^<]+)(<\/a>)/', '$1_title_$3', $fieldHTML); // 2. replace the stub with the current post title $fieldHTML = str_replace('_title_', $this->currentPostTitle, $fieldHTML); break; } return $fieldHTML; } } new FileWithPostTitle();
Don’t forget to replace the values to yours (see fixme comments).
Best regards.@justcarl There’s been no reply for a few days. We’re marking this ticket as resolved. Feel free to reply if you need more assistance.
RegardsHi @justcarl
There isn’t currently a built in way to limit the number of images, or to add pagination to ACF Gallery field within ACF Views.
RE: The last image stretching, could you give some more details. Are you using the CSS Code field in your View? Perhaps you could share the page url, then I can look at your specific case.
RegardsHi @justcarl
Thanks for your kind words.
We’re happy to hear you’re enjoying ACF Views.RE: Your Options page query, have you used the object-id=”options” parameter in your View?
Read more about the shortcode in our docs.
Forum: Plugins
In reply to: [Advanced Views - Display Posts, Custom Fields, and More] Event Espresso@andreatkc, Let us know if you still need assistance.
Forum: Plugins
In reply to: [Advanced Views - Display Posts, Custom Fields, and More] Event EspressoHi @andreatkc
I’d be happy to assist you.
Please provide some more information.What version of ACF Views are you using?
Can you share a link of the page with events on?If you’d prefer, you could also visit our website at wplake.org and send an email, as this is usually quicker.
Forum: Plugins
In reply to: [Advanced Views - Display Posts, Custom Fields, and More] CPT TemplateHi @artgoddess
No, ACF Views is for Display the Custom Post Types and their ACF Fields.
Creating Custom Post Types is done with the ACF plugin, since the release of ACF 6.1.Let us know if you need any more guidance.
Hi @emezing17
Repeater within a repeater isn’t supported at the moment.