areablock in block is not working properly - pimcore

as i understand, nested areablock are possible since long. but something's not working.
lets say we have two areas, one called 'nested' and one called 'text'.
this is view.php for text:
<div>
<?php echo $this->wysiwyg("content_wysiwyg"); ?>
</div>
this is view.php for 'nested':
<div>
<?php while($this->block('index')->loop()) { ?>
<div>
<?php echo $this->areablock('index_block'); ?>
</div>
<?php } ?>
</div>
i create a page, and insert the areas like this:
nested 1
text 1
nested 2
text 1.1
when i preview the page everything is fine. but when i view the same page without pimcore_preview=true text 1.1 is not displayed. the divs are there so the template gets included, but the content is missing.
what's going on here?

I had similar problem today.
Viz. I had problem with visibility of any editable item in front end.
You need to clear your cache and that's it.

Related

How to render page elements from hook_form_alter() drupal 6?

I need to render contact form field elements using form_alter function.
When I print $content variable in tpl file, the contact form loads entirely, instead of that I need to render fields separately like drupal_render(drupal_get_form(form['name'])).
For Drupal 7, you can refer to /modules/node/node.tpl.php as an example. Here is a code snippet in the file:
<div class="content"<?php print $content_attributes; ?>>
<?php
// We hide the comments and links now so that we can render them later.
hide($content['comments']);
hide($content['links']);
print render($content);
?>
</div>
<?php print render($content['links']); ?>
<?php print render($content['comments']); ?>
I'm not sure if there is difference in Drupal 6, but you can try.

Breadcrumb menu in wordpress

I am stuck on how to create a breadcrumb menu in my wordpress so that when I select the main menu, the path shows its first inner menu. For example I have a main menu About us and Company Profile as its child. When I am select the About us, I want to get the Compony profile page and also the breadcrumb like About us / Company profile. Is there any way to do so? any plugins? I currently using Breadcrumb NavXT plugin for creating breadcrumb
You can add breadcrumb without using any plugin like this. Please add below code into your themes functions.php file.
function breadcrumbs($id = null){
?>
<div id="breadcrumbs">
Home</span> >
<?php if(!empty($id)): ?>
<a href="<?php echo get_permalink( $id ); ?>" ><?php echo get_the_title( $id ); ?></a> >
<?php endif; ?>
<span class="breadcrumb_last"><?php the_title(); ?></span>
</div>
<?php }
Now whenever you want to add breadcrumb just call this function like this.
<?php breadcrumbs(); ?>
As you mentioned above you have to add about page id into this function and call this to company profile page if this page is child page of about page than this works.
<?php breadcrumbs($id); ?>

Lotus Web issue with browser

I have been using display.none, for the hid-whens for example, all the hidden fields were kept in a section and section was hidden from web by using Display.none.
This is working for Internet Explorer till IE 9, but for IE 10 all the hidden fields are shown.
Can anyone help in this matter. Any alternative or approach.
Without seeing the page it sis very difficult to guess.
Try validating the html through one of the many online html validators as something may not be closed or Notes might have given you an unwanted code addition .
Try adding a background color to the css #wrapper to make sure the css is being called.
Take a copy of the form and start removing all other elements one section at a time to see if something else is causing the issue.
Add {meta http-equiv="X-UA-Compatible" content="IE=10;IE=9; IE=8; IE=7; IE=EDGE" /} as the very top meta tag and see if that fixes it. Replace the curly braces obviously.
All the best in finding the issue.
It sounds like just the section element is getting hidden. Without seeing the code I can't tell why that changes between ie 9 and 10 but ie is famous for having varying behavior between versions.
One alternative that comes to mind: You could wrap the section and the fields in a DIV element using pass thru HTML and set that div's style to display:none. That is pretty standard and should work across browsers.
Update: To give you an idea what I'm talking about, check out this jsfiddle.
HTML:
<form>
<div class="wrapper">
<input type="text" name="Field 1" /><br />
<input type="text" name="Field 2" /><br />
<input type="text" name="Field 3" />
</div>
<span>Some text that won't be hidden.</span>
</form>
CSS:
.wrapper {
#display:none;
}
You can remove the # next to the display:none and see the difference, even in IE 10.
You'll need to look closely at the HTML being rendered by Domino and make sure that in fact all the fields you are trying to hide are surrounded by the DIV that is hidden.

Orchard CMS 1.7 - Change in header does not appear on the site. Layout.cshtml issue

I cannot figure out how to change a text in the header section of my site. I am trying to do this in my custom module's theme. This is how my header looks like:
<header>
<div class="container">
<div class="row-fluid">
<div id="Logo"><h1>#WorkContext.CurrentSite.SiteName</h1></div>
<h3>[ We Know Business ]</h3>
<a class="btn btn-navbar btn-menuh" data-parent="#collapse-nav" data-target=".collapse-menuh">btn</a>
<a class="btn btn-navbar btn-search" data-parent="#collapse-nav" data-target=".collapse-search">btn</a>
</div>
</div>
</header>
I changed [We Know Business] to [We know Businesses] but the updated text is not coming up on any page of my site.
However, my main objective is to use HTML5 and Responsive compatibility in IE8 by injecting conditional CSS and js like this:
<!--[if lt IE 9]>
<script src="/themes/intrust/js/html5shiv.js"></script>
<![endif]-->
I cannot see the above snippet in "View Source" option.
The reason I changed the text only to check whether I am doing it at the right place or not. When it didn't work I turned Shape Tracing tool on to see what template is being used for the header. But could not highlight any part of the header at all!
Isn't Layout.cshtml of my custom theme liable to render the header section? If not, which template I have to look for?
I must be doing something wrong here but cannot figure out what! Please help!
NB: I tried resetting IIS several times but had no luck either.
This is a bit late but what you are looking for is overriding document.cshtml.Orchard has a default in the folder Orchard\src\Orchard.Web\Core\Shapes\Views folder. Copy the file document.cshtml to your theme and put the items that you want in the header section of this document.

How to show CCK field in search result?

How to display custom CCK field (text or imagefield) in Drupal core search results page?
You need to override search-result-tpl.php in your theme. Copy it from modules/search to your themes directory, clear the theme cache, and you're set. You'll see that there is an array available to the theme file called 'result', which contains a bunch of data, including a node object. So your file becomes something like:
<dt class="title">
<?php print $title; ?>
</dt>
<dd>
<?php
// Here is the change
print $result['node']->field_name_of_cck_field['view'];
?>
<?php if ($snippet) : ?>
<p class="search-snippet"><?php print $snippet; ?></p>
<?php endif; ?>
<?php if ($info) : ?>
<p class="search-info"><?php print $info; ?></p>
<?php endif; ?>
</dd>
Good luck!
1 Copy search-result.tpl.php file from modules/search to your theme folder
2 For CCK text field add:
<?php if ($result['node']->field_name[0]['value']): ?>
<h4><?php print($result['node']->field_name[0]['value']); ?></h4>
<?php endif; ?>
3 For imagefield with imagecache:
<?php if ($result['node']->field_logo[0]['filename']): ?>
<img src="/sites/default/files/imagecache/path_to_file/<?php print $result['node']->field_logo[0]['filename']; ?>" />
<?php endif; ?>
4 CSS styling next.
Thanx for cam8001 & googletorp!
It depends how you do the search.
If you use views to build a search, you can decide yourself what to show.
If you're using some other search mechanics, you can use a combination of a proprocess hook, theming function, template you get the output you want. You should have the node object available, so displaying a CCK should be easy enough.
Edit:
For the Drupal core search module you need to overwrite the search-result.tpl.php in your theme, to alter how search results are printed. Here you can add or delete info. If you need more variables, you can create them for use in the template in a process hook. This is basic Drupal theming, check out the handbook.

Resources