Support has been upgraded!
The Support Forum is closed. Not to worry! Providing the top quality support you expect and we're known for will continue! We're not ending support, just changing where you submit requests. This will provide you with the best experience possible.
Premium Support
Have you purchased an addon for Connections such as one of our premium templates or extensions with a valid license and you need help?
Please open a Support Ticket in your user account.
Free Support
Are you using the free Connections plugin? Don't worry, you are still very important to us! We are still providing you with the same high quality support that we're known for.
Please open a new support topic in the WordPress support forums for Connections.
- This topic has 4 replies, 2 voices, and was last updated 4 years, 8 months ago by
Steven Zahm.
-
AuthorPosts
-
03/29/2019 at 3:21 pm #488405
Richard Mitchell
GuestHi Steven
You were able to give me advice on how to set up specific search results pages for the advanced search facility. Trying to be clever I have tried to do the same thing for categorised search with absolutely no success. Please can you let me know if this is possible as it would facilitate some mods I need on the site. I am using Cmap
Richard M
04/01/2019 at 5:33 am #488526Richard Mitchell
GuestGood Morning Steven,
Please consider this question resolved. I decided to take some time and look more closely at the directory structure I had in place and how to use the shortcodes properly. I succeeded in getting my requirements to work the way I wanted(after some considerable effort and research). I realise you are busy and not here to teach but I wonder if you could reccommend a good tutorial on the syntax to be used in shortcodes particularly with reference to single and double quotes and how what they do and how to use them. I suspect that this might well be of interest to others using these forums as CONNECTIONS benefits so much from their use.
Once again thanks for the use of your creation and the fantastic support you provide for a product that is so powerful and relatively inexpensive.
Best regards,
Richard M
04/01/2019 at 10:27 am #488548Steven Zahm
Keymaster@ Richard
RE: I wonder if you could reccommend a good tutorial on the syntax to be used in shortcodes particularly with reference to single and double quotes and how what they do and how to use them.
I did a web search on this topic an actually came up empty handed. Sorry, that I am unable to recommend a tutorial!
I do have this tutorial I wrote long ago:
I do not mention anything about quotes. Something I definitely can add.
RE: Could you give some examples of trouble you had with quotes?
The are actually very few rules, off the top of my head:
- Quotes are optional for single value options such as an ID number, true or false. When an option can take multiple words as values, quotes are necessary. This way WP knows that they are one value for a single option vs multiple options.
- DO:
[shortcode-tag option=1]
- DO:
[shortcode-tag option=true]
- DO:
[shortcode-tag option='true']
- DO:
[shortcode-tag option='one value for an option']
- DO NOT:
[shortcode-tag option=one value for an option]
. WordPress will read this as valueone
foroption
the remained of of words will be process as options with no value. And, a properly coded shortcode will discard those as invalid options.
- DO:
- Not a rule, but recommended… Always quote the option values even though in some cases they are not required to be quoted.
- DO:
[shortcode-tag option='true']
even though[shortcode-tag option=true]
is valid.
- DO:
- Not so much a rule, but a suggestion… Stick to a single quote type for you option values. Meaning, stick with single quote style. Meaning, use either only single quotes
'
or double quotes"
.- DO:
[shortcode-tag option='value']
- DO:
[shortcode-tag option="value"]
- DO NOT:
[shortcode-tag option='value"]
. Notice the different quotes being used.
- DO:
- When using a single quote (an apostrophe) within an option value, you must use double quotes:
- DO:
[shortcode-tag option="value's"]
- DO NOT:
[shortcode-tag option='value's']
. If you have a shortcode with multiple option value pairs this can really break the ability of WordPress to match the proper options and values leading to a broken shortcode at worse to unpredictable results at best.
- DO:
- Do not use fancy quotes, always use straight quotes when quoting the option values. This is a fancy single quote ‘ and this is a fancy double quote “. Outside of shortcodes WordPress will convert the straight quotes to be fancy quotes. To use straight quotes, you do not need to do anything special, just use the quotes on the keyboard as you normally would.
- Never copy/paste shortcodes or their option value pairs from a web page and paste them into the WordPress Visual Editor. In all likelihood you will be pasting in fancy quotes which break the ability of WordPress to properly read the shortcode. The underlying HTML of the source page will also be pasted into you page. This mean you will see a shortcode that looks right, but is actually not a shortcode at all with can not be properly read by WordPress.
- Always add and edit shortcodes using the Text tab and not the Visual tab in the WordPress Editor. This will help ensure that fancy quotes are not used and no HTML is pasted from a web page.
- NOTE: In the new WordPress Block Editor, use the Shortcode block.
All this said
Connections, when saving a page/post will actually attempt clean and repair the shortcode correcting some of the above, but it is basic and does have limitations. This was one of the best things I have ever added to Connections because support related issues in regards to shortcodes went way down.
Hope this helps, let me know!
-
This reply was modified 4 years, 8 months ago by
Steven Zahm.
04/02/2019 at 9:25 am #488613Richard Mitchell
GuestHi Steven,
Once again a fantastic support response from you paricularly in this case where it is not really a connections issue but a more general item to do with wp. Like you I could find nothing on the web getting even close to your very welcome response. If you can make this discussion appear in the forum search facilty under a number of keywords as I really think it would be of interest to many connections users.
Once again thanks for your massive support (best of any I have come across)Regards,
Richard M04/02/2019 at 11:34 am #488639Steven Zahm
Keymaster@ Richard
What I’;ve done is updated the the “Working with Shortcodes” page to include the tip in my last reply:
I wrapped sections in an accordion so it does not feel instantly overwhelming when you land on the page.
fyi…
Your support is being upgraded!
You can now log into your account and submit support tickets instead of using this forum:
Sometime in the near future the forums will go into read only mode and then eventually completely shut down.
- Quotes are optional for single value options such as an ID number, true or false. When an option can take multiple words as values, quotes are necessary. This way WP knows that they are one value for a single option vs multiple options.
-
AuthorPosts
You cannot reply to this support topic. Please open your own support topic.