WordPress.org

Support

Support » Plugins and Hacks » [Resolved] won't stop

[Resolved] won't stop

Viewing 12 replies - 1 through 12 (of 12 total)
  • Plugin Author Eli

    @scheeeli

    I like to use the HTML code on the source page for start and stop markers. Maybe use:
    start='<h2 class=”teaching-and-research-interest”‘ stop='</p’

    also, just a tip for testing, I usually wrap the shortcode in a textarea so that I can see the HTML code that would be out put, then delete it when the output looks right.

    Hope that helps.

    Aloha, Eli

    Hi Eli,

    Is there a way to get the shortcode to ignore styling in the external webpage? Any divs or property styles affect the rest of the content on my page….

    http://artemisediting.com/behavioral-science-policy/policy-areas-2/health/henry-aaron/

    Thank you for your help!

    Diana

    Plugin Author Eli

    @scheeeli

    It looks like the the HTML is picking up it’s formatting from the style tags in the header of your site. I might be best to just alter the output that you are bringing in so that it does not match those styles defined in your header.

    For example, if you don’t want those H3 tags that say “Contact” and “Resources” to be blue gradient bars, you could just change them to an H2 or H1 by adding this to your shortcode call:

    replace='h3>' with='h2>'

    I don’t want that content to show up at all. I set the stop before that content, but it keeps going, pops my divs out of whack, and overrides styling. I think the html is picking up the style tags from the external content, rather than from my code.

    Plugin Author Eli

    @scheeeli

    Can you paste your whole shortcode in here so I can test what content it gets?

    Sure!

    I’ve tried it both of these ways (because I don’t really know what the whole replace extend thing is):

    1.
    [remote_get url=”http://www.brookings.edu/experts/aaronh?view=bio” start=”Henry J. Aaron is” stop=”/p>He is a member” replace=”=’/extend” with=”=’http://wordpress.org/extend” replace2=”%2Fextend%2F” with2=”http%3A%2F%2Fwordpress.org%2Fextend%2F”]

    2.
    [remote_get url=”http://www.brookings.edu/experts/aaronh?view=bio” start=”Henry J. Aaron is” stop=”/p>He is a member”]

    Removed the / in the stop statement, but it still creates the div and pops the sidebar under the page.

    [remote_get url=”http://www.brookings.edu/experts/aaronh?view=bio” start=”Henry J. Aaron is” stop=”p>He is a member” replace=”=’/extend” with=”=’http://wordpress.org/extend” replace2=”%2Fextend%2F” with2=”http%3A%2F%2Fwordpress.org%2Fextend%2F”]

    Plugin Author Eli

    @scheeeli

    ok, well the first issue is that it is not stopping where you want it to because it is a p tag, not a /p tag, before the words “He is a member”.

    Also, there are some messy /div endings in the middle of this content and a couple of div tags after that so be sure to open all the tags that this content wants to close before calling the shortcode, and close all the tags that that this content open after the shortcode or you will have some pretty bad HTML formatting on this page.

    Something like this should be close to what you want:

    <div><noindex><div><div>
    [remote_get url="http://www.brookings.edu/experts/aaronh?view=bio" start="Henry J. Aaron is" stop="p>He is a member"]
    /div></div>

    Note: my first /div after the shortcode does not have a < because the parsed content already ends with that character.

    Let me know how that works for you.

    Aloha, Eli

    Ahh. Okay. I had fixed the /p thing, but it looks like whatever bad HTML exists in the pages I call out to will have to be fixed ahead of time. So it’s not really scalable to do for 100 profiles from different institutions, huh?

    I really appreciate your help.

    Plugin Author Eli

    @scheeeli

    Not if the pages are all formatted differently.

    Are there no similarities across the board that you can use?

    I know all the pages will have a body and /body in them but you probably don’t want to get the whole page, right?

    The other thing to watch out for is that if the page is updated and the marks you are looking for change then your parsing will fail and your page will be all broken looking. There may not be a good automated approach here.

    Yeah. All the pages are from different institutions. I guess I could pull from body to /body, but I think that will bring too much content into the page and each person has different content types.

    I really appreciate your help. I’ll have to start copying and pasting…. 🙂

    I think your plugin is awesome, though. My case is just unusual.

    Plugin Author Eli

    @scheeeli

    Thanks. I set the status of this topic to closed, but do let me know if you ever need more help with it.

    Aloha, Eli

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘[Resolved] won't stop’ is closed to new replies.