I' m trying to get an ajax call working - so that if a user clicks a button a paragraph of text is changing (among other things).
The php-file handling the call is in the root directory and bootstrapped. This is the code at issue:
<?php
// bootstrap ProcessWire
// Because this file isn't - and can't be - in the templates directory
// see:
include('../index.php');
$nlPage = $wire->pages->get("/newsletter/");
$newText = $nlPage->text_without_p_tags;
echo $newText;
?>
This should return plain text without <p> tags because the field is formatted with "Paragraph Stripper". If I output this 3 lines of code through a regular template file It works like expected but this file returns the text with <p> tags.
I would like to know why this is so and how I can solve it.
There must be something going on with the bootstrapping or I just don't get it ...
Another thing is that if I want to resize and output an image with the field set to "maximum file 1" - thus just one image - to get it working I have to handle it as an array.
This confuses me somehow ...
Thanks for any help on this!