Readfile Issues Using blocks on nonPulse site


#1

I am using Pulse5.1 blocks on a non-Pulse site. I create new pages on my local server using Dreamweaver and upload them to the remote server when they’re ready to publish. In Pulse 3 I was able to use a php “include_once” statement to insert the html block. I could use the same site-root relative file path on my local server as on my remote server.

Is there any way to do this in Pulse5 without changing the filepath in the readfile call when I move between my local and remote servers?


#2

Probably not easily currently - because the install has auto URL detection and file path setting built-in to make it easy to setup and then users would add new Block contents on the server.

We made them absolute so they could potential be used across domains for multi-site management. But relative should also work if you try the relative call.

If not, we can think about adding this in to make it easier in this use case :slight_smile:


#3

I can not get the relative path to work. As you can see Pulse5.1 is install in the subdirectory pulsemcms.

Here’s the php statement that works:

<?php readfile('http://localhost/pulse5_test/pulsecms/end_point.php?item=blocks%2Fvehicles%2F566'); ?>

These do not work:

<?php readfile('/pulsecms/end_point.php?item=blocks%2Fvehicles%2F566'); ?> <?php readfile('../pulsecms/end_point.php?item=blocks%2Fvehicles%2F566'); ?>

Here’s the error message:

( ! ) Warning: readfile(…/pulsecms/end_point.php?item=blocks%2Fvehicles%2F566): failed to open stream: No error in C:\wamp\www\Pulse5_test\pulse5test.php on line 92
Call Stack

Time Memory Function Location

1 0.0010 139168 {main}( ) …\pulse5test.php:0
2 0.0010 139416 readfile ( ) …\pulse5test.php:92

Thanks for your continued assistance.


#4

Thanks @gweng for the information

At the moment absolute works :white_check_mark:

Relative we’ll have to look at adding that as most situations this is used for embedding sites or content already live so hadn’t imagined this use case, but we can see about adjusting it :slight_smile:

5.2 will be out soon and we’ll see about getting this in there if we can


#5

@gweng

Looking into this more, I don’t think a relative embed url will work in general.

Relative on the filesystem does not map onto relative urls at all.

If the block you want to link to doesn’t contain other pulse tags (or pulse related constants) then a relative path to the block txt file would work.

Otherwise, I would suggest move it onto the server (like a repository or Warehouse method of storage) then link to it using absolute method and it will remain consistent wherever you move your Pulse install.


#6

Thanks for looking into this for me. My block does not include other Pulse tags but I must confess I don’t know what you mean by the following:

Thanks,

Gwen


#7

Thanks - means if there’s no Pulse magic happening in the Block (so just text for example) then relative should work

If not, you might need to send in (private message is fine) more details and we’ll take a look!


#8

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.