Design's MySource_print in situ


#1

Is it possible to print the design area called by MySource_print in situ rather than where the MySource_print is triggered from? 

 

e.g. the below code prints the staff_nav within div.site-center, rather than div.nav where this design area is located.

(Matrix v4.16.1)

<div class="site-center"> 
  <MySource_AREA id_name="staff_nest" design_area="body" print="no" />
  
  <MySource_area id_name="customer_nest" design_area="nest_content" print="no">
<MySource_set name="type_codes" value="page" />
  </MySource_area>
  <MySource_AREA id_name="visitor_detect" design_area="show_if">
<MySource_SET name="condition" value="user_ip"/>
<MySource_THEN>
  <MySource_print id_name="staff_nest" />
  <MySource_print id_name="staff_nav" />
</MySource_THEN>
<MySource_ELSE>
  <MySource_print id_name="customer_nest" />
  <MySource_print id_name="cust_nav" />
</MySource_ELSE>
  </MySource_AREA>
</div>

(Bart Banda) #2

Wouldn't you just change the print tag to a nested tag? Just like you have in the class="nav" area?

 

So:

<div class="site-center"> 
  <MySource_AREA id_name="staff_nest" design_area="body" print="no" />

<MySource_area id_name=“customer_nest” design_area=“nest_content” print=“no”>
<MySource_set name=“type_codes” value=“page” />
</MySource_area>
<MySource_AREA id_name=“visitor_detect” design_area=“show_if”>
<MySource_SET name=“condition” value=“user_ip”/>
<MySource_THEN>
<MySource_AREA id_name=“staff_nav” design_area=“nest_content” print=“no”/>
</MySource_THEN>
<MySource_ELSE>
<MySource_AREA id_name=“cust_nav” design_area=“nest_content” print=“no” />
</MySource_ELSE>
</MySource_AREA>
</div>


#3

Thanks Bart, but wouldn't this print the nav asset within the site-center div?

 

I mightn't have explained very well (or attempting something odd) but my aim is to have the nav asset print within the nav div above.

Perhaps I require a separate show_if design area for this but it would be good to avoid.


(Bart Banda) #4

Ah right, I think you just need 2 show if design areas then, one for the nav above and one for your site center to print everything else.


#5

Cheers Bart, will do.

I was hoping to do away with the one design area as I have a range of IPs to detect - would've been nice to set in one place but no major biggie all the same.