[Pro] Problem with Perch and Crowbar?

I’m having some trouble getting Crowbar to accept some PHP code I’m using to insert Perch content into a page. The error message I’m getting is, “A surrounding tag could not be detected. Your code was not added to the page.”

Here’s the code:

<?php perch_content_custom('Image', array(
	'page'=>'//index.php'
)); ?>

And here are the instructions:
http://docs.grabaperch.com/docs/content/perch-content-custom/

What am I doing wrong?


offtopic mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Crowbar will only throw that error if it cannot find the surrounding tag to apply the code to. Can you say a little more about how you are applying it? Is it inline within an HTML box? Crowbar is entirely agnostic about the code you insert – it genuinely doesn’t care about that. The issue is your page construction and where you’ve inserted the Action-item.

Walter

On Feb 5, 2014, at 5:47 PM, RavenManiac wrote:

I’m having some trouble getting Crowbar to accept some PHP code I’m using to insert Perch content into a page. The error message I’m getting is, “A surrounding tag could not be detected. Your code was not added to the page.”

Here’s the code:

<?php perch_content_custom('Image', array(
	'page'=>'//index.php'
)); ?>

And here are the instructions:
http://docs.grabaperch.com/docs/content/perch-content-custom/

What am I doing wrong?


offtopic mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


offtopic mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

I’ve placed the Crowbar code inside an HTML item. Looking at the code, it appears that Perch is trying to insert it into a table, which strikes me as very odd. Here’s the code.

			<div id="item1"><table style="border-spacing:0px; width:101px; table-layout:fixed">
					<colgroup>
						<col style="width:100px">
						<col style="width:1px">
					</colgroup>
					<tr style="vertical-align:top">
						<td>&perch-image;</td>
						<td></td>
					</tr>
					<tr class="f-sp">
						<td><img src="../Resources/_clear.gif" width=100 height=1 alt="" style="float:left"></td>
						<td style="height:1px"><img src="../Resources/_clear.gif" width=1 height=1 alt="" style="float:left"></td>
					</tr>
				</table>
			</div>

offtopic mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Is that HTML item a blue-border table layout element, or a green-border DIV? Check in the Inspector to see if Layer or CSS (if it’s inline) is checked. Also look in the style tab to see if you’ve added a graphic background or curved corners to the box. Those come with tables that you wouldn’t expect, too.

Walter

On Feb 5, 2014, at 7:48 PM, RavenManiac wrote:

I’ve placed the Crowbar code inside an HTML item. Looking at the code, it appears that Perch is trying to insert it into a table, which strikes me as very odd. Here’s the code.

			<div id="item1"><table style="border-spacing:0px; width:101px; table-layout:fixed">
					<colgroup>
						<col style="width:100px">
						<col style="width:1px">
					</colgroup>
					<tr style="vertical-align:top">
						<td>&perch-image;</td>
						<td></td>
					</tr>
					<tr class="f-sp">
						<td><img src="../Resources/_clear.gif" width=100 height=1 alt="" style="float:left"></td>
						<td style="height:1px"><img src="../Resources/_clear.gif" width=1 height=1 alt="" style="float:left"></td>
					</tr>
				</table>
			</div>

offtopic mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


offtopic mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Walter, it was a user error—as usual.

I’m still getting used to where Perch puts things. Sometimes you have to specify a directory, other times you don’t. All is good. I’ll post a link as soon as I get everything straightened out. Thanks for your help.

K


offtopic mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options