-
AuthorPosts
-
December 9, 2022 at 9:17 pm #12138GraysonParticipant
I am trying to insert the shortcode from “Inline Google Spreadsheet Viewer” plugin which creates and HTML table from a Google sheet. I want to display only one cell from the sheet inline within text. I believe the original shortcode is enclosed by which drops any text below.
The goal is to have a sentence such as …. “The top rated player is [shortcode] as of [date]”
I thought this may be possible with you code, but maybe not?
December 9, 2022 at 9:34 pm #12139Aakash ChakravarthyKeymasterHi Grayson,
Are you creating a shortcode using Shortcoder?
What is the content (i.e HTML) of the shortcode?
I would like to know how “inline google spreasheet” plugin comes into play.When you meant
[shortcode]
I’m nto sure if it is shortcoder’s one or the other plugin you mentioned.Can you please share more details? Screenshots would also help.
Thanks,
AakashDecember 9, 2022 at 10:02 pm #12140GraysonParticipantInside my shortcoder code is:
[gdoc key=”https://docs.google.com/spreadsheets/d/MYGOOGLESHEETID/edit#gid=18337438″ query=”select AE limit 1 offset 2″ display=”inline” class=”no-datatables” use_cache=”no”] $$enclosed_content$$
named …. [sc name="maleleader"]is the Men’s rating leader![/sc]
which returns ….
White, Bob (4.08)
is the Men’s rating Leaderwhere I would like it to be: “White, Bob (4.08) is the Men’s rating Leader
However, I believe this has to do with the shortcode I used within [sc] [/sc]
December 9, 2022 at 11:44 pm #12141Aakash ChakravarthyKeymasterHi @grayson,
I guess the gdoc shortcode is adding a newline at the end.
Without using shortcoder can you directly insert the shortcode in a test post and see the results?
example:
[gdoc key=”https://docs.google.com/spreadsheets/d/MYGOOGLESHEETID/edit#gid=18337438″ query=”select AE limit 1 offset 2″ display=”inline” class=”no-datatables” use_cache=”no”] is the Men’s rating Leader
Observe the output of the post. If the line breaks, then gdoc is adding a new line at the end of it’s output.
Thanks,
AakashDecember 9, 2022 at 11:55 pm #12142GraysonParticipantThat is the reason I tried your plugin as I already tried that possibility. You are correct.
Thank you. You’re plugin is truly useful.December 10, 2022 at 12:42 am #12143GraysonParticipantI was able to use the below code in your plugin to do the trick. I justslapped all in a HTML table.
<table><tr><td>[gdoc key=”https://docs.google.com/spreadsheets/d/MYGOOGLESHEETID/edit#gid=1833743368″ query=”select AE limit 1 offset 2″ display=”inline” class=”no-datatables” use_cache=”no”] </td><td>is leading Men’s and</td><td>[gdoc key=”https://docs.google.com/spreadsheets/d/MYGOOGLESHEETID/edit#gid=1833743368″ query=”select AF limit 1 offset 2″ display=”inline” class=”no-datatables” use_cache=”no”]</td><td>is leading Womens!</td></tr></table>
Your plugin did it! Thank you!
It now renders all in one line:
“Bob White (4.02) is leading Men’s and Jane Doe (3.15) is leading Women’s!December 10, 2022 at 5:15 pm #12146Aakash ChakravarthyKeymasterHi @grayson,
Shortcoder helps to create “shortcodes” for frequently used HTML/CSS/JS snippets. It does not alter the content. So what you see without a shortcode is what you see with a shortcode.
Glad that you found a workaround.
Thanks,
Aakash -
AuthorPosts
- The topic ‘Shortcode inline with text … no line breaks’ is closed to new replies.