Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • Grayson
    Participant

    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?

    Hi 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,
    Aakash

    Grayson
    Participant

    Inside 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 Leader

    where 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]

    Hi @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,
    Aakash

    Grayson
    Participant

    That is the reason I tried your plugin as I already tried that possibility. You are correct.
    Thank you. You’re plugin is truly useful.

    Grayson
    Participant

    I 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&#8243; 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&#8243; 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!

    Hi @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

Viewing 7 posts - 1 through 7 (of 7 total)
  • The topic ‘Shortcode inline with text … no line breaks’ is closed to new replies.

Subscribe to our Newsletter

Get updates on the WordPress plugins, tips and tricks to enhance your WordPress experience. No spam. View newsletter

By using this website, you agree to our Terms