Global area location moved to a different div!

Permalink 0 2 Browser Info Environment
I have the following chunk of code in a theme I am developing:

<div class="theme-hl d-none d-md-block" data-collapse="true">
<div class="container">
<div class="row m-0">
<div class="theme-hl-logo float-left"><?php $a = new GlobalArea('Header Lower Logo'); ?></div>
<div class="theme-h-nav col align-self-center"><div class="d-flex justify-content-center">
<?php $a->display($c);$a = new GlobalArea('Header Nav'); $a->display($c); ?>
</div></div>
<?php
$site = Site::getSite(); 
$target = $site->getAttribute('search_target');
if ($target > 0):
$npage = \Page::getByID($target);
?>
<div class="theme-hl-search float-right">
<search use-popup="true" action="<?php echo $npage->generatePagePath(); ?>"/>


The "header lower logo" Global area is MOVED out of the div it is in and relocated to immediately before the next global area in the rendered HTML. The original location is just left empty.

This is shown happening in edit mode under the chrome developer tools, and occurs in final rendering.


Status: New
View Best Answer
mlocati replied on at Best Answer Permalink Reply
mlocati
The problem is in your code: the area is rendered where you have
$a->display($c);

and not where you have
<?php $a = new GlobalArea('Header Lower Logo'); ?>
barrypearce replied on at Permalink Reply
Yes! Thank you!
Sometimes despite knowing you have done something sill you just cant spot it!

concrete5 Environment Information

# concrete5 Version
Core Version - 8.4.3
Version Installed - 8.4.3
Database Version - 20180716000000

# concrete5 Packages
CoreBSP Catalyst theme. (0.0.1), Custom Package (0.0.3)

# concrete5 Overrides
None

# concrete5 Cache Settings
Block Cache - Off
Overrides Cache - Off
Full Page Caching - Off
Full Page Cache Lifetime - Every 6 hours (default setting).

# Server Software
Apache

# Server API
fpm-fcgi

# PHP Version
7.2.10

# PHP Extensions
cgi-fcgi, Core, ctype, curl, date, dom, fileinfo, filter, gd, hash, iconv, json, libxml, mbstring, mysqli, mysqlnd, openssl, pcntl, pcre, PDO, pdo_mysql, Phar, posix, readline, Reflection, session, SimpleXML, SPL, standard, tokenizer, xml, xmlreader, xmlwriter, zip, zlib

# PHP Settings
max_execution_time - 30
log_errors_max_len - 1024
max_file_uploads - 20
max_input_nesting_level - 64
max_input_time - 60
max_input_vars - 1000
memory_limit - 128M
post_max_size - 8M
upload_max_filesize - 200M
mysqli.max_links - Unlimited
mysqli.max_persistent - Unlimited
pcre.backtrack_limit - 1000000
pcre.recursion_limit - 100000
session.cache_limiter - <i>no value</i>
session.gc_maxlifetime - 7200

Browser User-Agent String

Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36