I am trying to: search toolset custom posts with Relevanssi search implemented
Link to a page where the issue can be seen: hidden link (try to search 14153 in the search field in the header). The post exists but it is not displayed in the search results. If we enter the post in the custom posts area and click UPDATE, the post is now visible in the search results.
This happens only with some custom posts (we do not understand what can be the difference between the posts that are displayed and the one that are not).
Any guess about that?
Thanks for your info.
Franco
Hi, I'll try to help. Please answer these questions for me:
1. What is "14153"? Is it a CPT post ID, or a CPT post title, or the value of a custom field, or something else?
2. Which post should appear in the results when you search for 14153? Please provide a URL so I can see it on your site.
3. Before you click "Update" to update this post, go to Settings > Relevanssi > Indexing and click "Index unindexed posts" to build the index. Does the post appear in search results now? If not, go to Settings > Relevanssi > Index and click "Build the Index". Test again.
4. Does the post appear in search results now?
Dear Christian,
we re-indexed the "unindexed posts" and now the post does appear in the search results, but the re-indexing gave us the alert that other 8 posts are not indexed but there is no log file to see what are those posts and more important, the reason why they are not indexed.
Any further help on this?
Thanks
Franco
Hard to say for sure, that may be more of a question for Relevanssi support. I know that Relevanssi does not automatically index your existing site when you activate it. So if you created some posts, then activated Relevanssi, then created some more posts without ever clicking the index button, the posts you created before activating Relevanssi would not have been indexed yet. The posts you created since activating Relevanssi would have been indexed automatically. That's normal - you have to instruct Relevanssi to index existing posts by clicking the index button at least once.
I re-indexed all site but there is some missing posts. I will see if relevanssi will help me about the log info of non-indexed posts.
Anyway, is t possible to include a data of a custom toolset field in the mail body of Contact form 7?
Thanks for yur info.
Franco
I re-indexed all site but there is some missing posts. I will see if relevanssi will help me about the log info of non-indexed posts.
Okay you should check your Relevanssi settings to be sure these posts are selected for indexing. If they belong to a custom post type that is not selected for example, that could be part of the problem. Those configurations are on the same tab where you can build the index.
Anyway, is t possible to include a data of a custom toolset field in the mail body of Contact form 7?
I'm not sure how Contact Form 7 works, so I'm probably not the best source of information about this. If they allow you to insert standard shortcodes, you can use the Types field shortcode:
[types field="my-singlelinetext" id="12345"][/types]
Replace 12345 with the ID of the post containing the custom field, and replace "my-singlelinetext" with the slug of your custom field as defined in wp-admin. If Contact Form 7 does not allow standard shortcodes, then I suggest asking their support team for some assistance accessing a custom field value inside the body of an email. Types fields are stored with a slug prefix of "wpcf-", so a field with the slug "my-singlelinetext" in wp-admin will be saved in the database as "wpcf-my-singlelinetext". If you provide CF7 support with that information they should be able to point you in the right direction.
More information about the Types Field shortcodes here:
https://toolset.com/documentation/customizing-sites-using-php/functions/#textfield
Click the orange "More info" button to show examples.
Hi Christian,
unfortunately we tried some tests but something doesn't work with the shortcodes and we are not able to transcode the field value in the e-mail on Contact Form 7.
What we need is not to ask the user to fill in a form field and then have it displayed in the e-mail , but to insert a hidden field in the form that picks up the value of the custom field so to display it only in the e-mail notification.
Any guess about that?
Thanks
Franco
I'm not familiar with their software, sorry!
I can tell you how to access Toolset fields in the database, or using our shortcodes, but not how to set the value of a hidden field in a Contact Form 7 form. If their software allows you to use a shortcode to set the value of a hidden field, you should be able to use one of these shortcodes:
[types field="my-singlelinetext" id="12345" output="raw"][/types]
[wpv-post-field name="wpcf-my-singlelinetext" id="12345"]
You'll have to modify the field and ID.
If these do not seem to be working, try to insert the shortcodes in a simple post or page first. Then once you have a working shortcode, copy + paste that into your Contact Form mail template. If it's not working then, you'll need to contact their support team to find out the best way to specify the value of a hidden field.
Hi Christian,
thi smorning we made some tests by working with the shortcodes and we found the solution (it could be useful for any other people that is reading this post).
We installed the plugin:
Contact Form 7 Dynamic Text Extension
hidden link
Then, in the MODULE code:
[dynamichidden riferimento "types field='id-riferimento'"]
Where id-riferimento is the slug of the custom field WITHOUT prefix.
In the EMAIL code:
[riferimento]
Where in both codes "riferimento" can be decided freely based with the name you want to give to the field.
Best regards,
Franco