Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > RocketCake
Applying breakpoints to PHP output

firkin
Registered User
Quote
2017-10-08 06:13:12

Is there any way to apply breakpoints (specifically changing the font-size) to the output of PHP elements?

I have tried placing the PHP code inside a container, setting the font size for the container and then creating breakpoints to alter the font size as the screen size changes, but the PHP output (e.g.
echo "Hello world!";
) does not respect the font style of the container.

I have also tried simply setting breakpoints for font size on the PHP element itself, but the output does not respect these either.

Am I missing something?


erik
Registered User
Quote
2017-10-08 11:22:49

Does the output you write end up in the container? Maybe somehow it is written outside of that div created? did you look into the code you get in your browser?


firkin
Registered User
Quote
2017-10-08 12:44:30

Here's the code of a simple example. You can see that different text styles are applied to the text in the container outside the PHP element. In this case, the 'CreateDivAroundCode' check box was not selected, but it makes no difference to the text styles applied. Any text formatting attached to the container is only applied via <span> tags to text within the container, not the PHP output.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="generator" content="RocketCake">
<title></title>
<link rel="stylesheet" type="text/css" href="index.html.css">
</head>
<body>
<div class="textstyle1">
<div id="container_8538c1f">
<div id="container_8538c1f_padding" >
<div class="textstyle1">
<div id="container_26be2b">
<div id="container_26be2b_padding" >
<div class="textstyle1">
</div>
</div>
</div>
<div id="container_25ee779">
<div id="container_25ee779_padding" >
<div class="textstyle1">
<?PHP
echo "Hello world inside PHP element";
?> <span class="textstyle2">Hello world outside PHP element</span>
</div>
<div style="clear:both"></div>
</div>
</div>
<div id="container_7d1752af">
<div id="container_7d1752af_padding" >
<div class="textstyle1">
</div>
</div>
</div>
</div>
<div style="clear:both"></div>
</div>
</div>
</div>
</body>
</html>



erik
Registered User
Quote
2017-10-08 15:56:34

You are right, that doesn't seem to work. When you enable that "create div around PHP code" option, you get an Id for that PHP section, something like

<div id="php_8538c1f">


You can use that Id and add a style in the additional CSS styles, to format it. Click the menu "View -> HTML Code of the page -> Additional CSS Styles"and paste something like (with the id your PHP section has):

php_8538c1f { font-size:16pt; font-family:Arial, Helvetica, sans-serif; color:000000; }

(add a HASHTAG character as first character before that id in the css section, this forum swallows that character unfortunately)

Not so nice, but it works.


firkin
Registered User
Quote
2017-10-09 01:19:20

Thank you so much, erik, for your help. I don't mind the slight clumsiness of this - RocketCake is such a good product.

Just to clarify for anyone else reading this thread:

To format the PHP output outside breakpoints, first identify the id of the wraparound div as detailed by erik in previous post.

Use the View menu to select HTML Code of Page.

Use the Additional HTML Code dropdown menu to select Additional CSS Styles.

Create the CSS style using the php_xxxxx label of the wraparound div.

Click OK.

Then to add breakpoint changes, select the PHP element in your page, right click and select Edit Breakpoints.

Click Add and select User defined CSS and make any adjustments to your CSS for any breakpoints.


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "Internati?nal" (you are not logged in)


Text:

 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


   






Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact