Hiding a Web Content Viewer JSR 286 Portlet if no content is found - websphere-portal

I have configured a JSR 286 portlet on my portal page which points to a content item. The content item has an expiry date. Once the content expires the user sees default warning message saying no content found for the selected site area.
I want this portlet should not be rendered if there is no content in the selected site area instead of showing a warning.

Use a Menu Component that is set to only display 1 item for your portlet. Then create a second content item that has a Presentation Template that just says something like this:
<div class="emptyPortlet" style="display:none;"> This is an empty template. </div>
*if you don't want to declare the style inside the tag, you could also specify .emptyPortlet { display: none;} inside your CSS file.
Publish this before your other item and then set the Menu Component to display based on Publish Date. This way, when you create another item that you want to display (which uses a different Presentation Template), it will have a more recent publish date and will be shown on the page. But, once that is expired, the only published item left to find will be this blank one, and with "display: none" it will essentially hide the entire portlet from the user.

You have a few options
Easiest would be to create a custom skin that shows or does not show depending on it's internal contents. just create your own skin to return nothing
Your other options include scraping it out of the response with a servlet filter or some other mechanism or stripping it from the page once you have started rendering

Related

2sxc App | Demo Content | Auto Fill

I have a series of modules based on the 'Content' App that I have created demo content for but as per the templates once I click edit the content data doesn't pre fill into the UI fields (which is something I'm trying to achieve).
I know the 'Content' App module templates are not Apps on their own like the 'FAQ'/'Accordion' Apps which I thought were capable of this pre fill presentation of demo content. How do you set an App's demo presentation content to display in the input fields of the UI?
I am currently looking at the Visual Query Designer but is this the only way to assign demo content to auto fill into the UI fields once a user clicks edit?
NOTE: My goal is to create a dnn template page of modules all displaying demo content (each assigned its own one) and then either copy this page or import it to another whereby the demo content has actually pre filled the modules on the new page once a user clicks on the edit button.
Thx
you can go to the "fields" of the content type and click on the "data type" ie sting, hyperlink etc and you should be able to set a default value

Custom Theme template in Drupal 7

I know, if you want to check the names of the Display Output of the view page then we need to click on the Information Link near by Theme of Advance Theme of the view, it will list all the files.
After clicking on this, it will list.
Display Output : (View Machine name is add_to_cart)
views-view.tpl.php, views-view--add-to-cart.tpl.php, views-view--default.tpl.php, views-view--default.tpl.php, views-view--page.tpl.php, views-view--add-to-cart--page.tpl.php
So, could you please suggest which files should be best for creation of the Display Output template of the view page ?
If you want specific theming to your page display of add_to_cart view, then choose
to override views-view--add-to-cart--page.tpl.php.
I'll also want to add the importance of naming convention for templates, so that, next time, you can choose the template name yourself:
views-view.tpl.php: called for every view.
views-view--add-to-cart.tpl.php: called for only add_to_cart view.
views-view--default.tpl.php: called for the display: default(master display) of every view.
views-view--page.tpl.php: called for the display: page of every view.
views-view--add-to-cart--page.tpl.php: called for the display: page of only add_to_cart view. (the specific suggestions are always last)
Note:
Template naming suggestion flow: general to specific.
Also when you click the display output, you can copy the code for the template. This way you get all the variables that are available to you.
Hope this help else comment for queries.
Understanding how default, page comes in template names:
Within a view, you can create many displays as shown below.
Each display has a Machine Name, for eg: System display has a machine name: system_1. So, a view with system_1 display will be overrided using views-view--system-1.tpl.php. Note: the underscore('_') is replaced with hyphen('-'). The by default view display or master display in a view has a machine name: default.

Fire Google Tag Manager GTM Tags on Angular Clicks

My development team has created a single page website with many links like this:
Geography
and
Demographics
How can I create Google Tag Manager tags which can differentiate these as separate events since they have the same href as "javascript:"? Is there a way to make the event name based off of the anchor text?
Thanks!
In GTM, you can try to utilise the {{Click Text}} variable which, according to GA documentation, is
Click Text: The visible text inside the clicked element.
You would just need to make sure that the anchor element is your clicked element, and the text would follow from that.

Drupal view Image link to a page of same content type in views

I have a content type called Realisation.
Realisation
Title
Body
Thumb Image
I create a Block View and a Page View
Page View
I display only Title, and the Body.
I setup the path url parameter as "/MyRealisation"
In the block view
I only show a list of Thumb Image.
I link my Thumb Image with the content.
When I click on my image, it's not using my custom Page View.
I Notice that the path is wrong. It show node/62 instead of /MyRealisation/node/62
Is there any reason ?.
Thanks a lot.
If you want have url each nodes like so site.com/MyRealisation/node/62
You need install module pathauto
Next you need go to admin/config/search/path/patterns and from this page write your templates for any node types

salesforce: How do I set custom tag homepage?

I've created custom object and custom tab (label text="order").
Now my header looks like below just like everyone can do.
[home]__[customer]__[order]
And when I click on "order" tab, I am redirected to home page of "order"
The "order" homepage has:
view (which goes to search feature)
recent record
My question is how do I change the layout of this homepage? I've look though entire site and documentations but seems like it is not possible. The only option I have is to create brand new visualforce page and set that page as default homepage for the "order" tab.
No, you can't change the contents of a default tab homepage beyond the limited controls under Setup. You would have to create a new Visualforce page and replace the page all together; however, with an enhancedList, you can get the basics down without too much coding, like this:
<apex:page>
<apex:enhancedList type="Account" height="500" />
</apex:page>
This would just show the standard Account list views on the tab (which could have Recent Items), but you could spruce things up with other components or make the list view customized with a set controller.

Resources