Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsRepositoryRepositoryTwo Template QuestionsTwo Template Questions
Previous
 
Next
New Post
5/9/2008 4:44 PM
 

I downloaded the user manual for the Repository module and have two questions.

1.  How would I specify that a field is required or optional?  Or are TITLE and FILE always required?  (I want FILE to be optional, if possible.)

2.  Can I apply any logic to a template?  For instance, if an item has no Summary, is there any way to skip part of the display template?

 
New Post
5/9/2008 5:17 PM
 

I figured out my issue with making [FILE] optional by adding the following to form.xml:

<Object>
<Token>[FILE]</Token>
  <Settings>
   <Setting>
    <Name>Required</Name>
    <Value>False</Value>
   </Setting>
  </Settings>
</Object>

 
New Post
5/10/2008 9:33 AM
 

Correct way to do it .. good job.

On you second question, you can certainly do it. In the template.html file wrap a div around the section you want to hide, then you can add custom javascript to your header.html file ( you would want to add it to the header or footer templates so that the javascript is only output to the page once. If you add it to the template.html file it will be output multiple times, once for each item ). In the javascript, add a function that will set the style.display to 'none' if the summary data is blank, something like

HideIfBlank(itemId, divId)

then, finally at the bottom of your template.html file, add a javascript call to the function which will look at the itemId.value and if it's blank set the divId.style.display to 'none'.

That should do it :)

If you have any problems, let me know

 
New Post
5/12/2008 3:26 PM
 

Steve,

I'm really not that good with JavaScript.  What I'm trying isn't working....hopefully someone can assist.

Here's what I'm trying:

in Header.HTML:

function HideIfBlank(itemID, divID) {

var itemID=document.getElementByID(itemID);

var divID=document.getElementByID(divID);

if (itemID.innerHTML='') {

divID.style.visibility = "none"

}

}

</script>

</head>

 

In Template.HTML:

 

<span id="info[ITEMID]">[DESCRIPTION]</span>

-snip-

<script>

<!--

HideIfBlank(info[ITEMID],info[ITEMID]);

-->

</script>

<head>

<script>

 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsRepositoryRepositoryTwo Template QuestionsTwo Template Questions


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out