Small width layout Medium width layout Maximum width layout Small text Medium text Large text
     Search
Downloads Downloads Directory Directory Forums Forums Forge Forge Blogs Blogs        Marketplace Marketplace Careers Program Careers
Community › Forums Register  |  

AppTheory specializes in solutions based on the DotNetNuke platform and has 2 employees on the DotNetNuke Core Team.
  Ads  
Active Modules -- Active Forums for DotNetNuke
 


  Sponsors  

Meet Our Sponsors

WebSecureStores -- ASP.NET & DotNetNuke Hosting Solutions
FCKeditor Project
Salaro -- Skins and more
OnyakTech
The best choice for your web site host, email hosting, and domain registration.
CrystalTech Web Hosting™
 


DotNetNuke Forums
 
  Forum  DotNetNuke® Pro...  Repository Modu...  Two Template Questions
Previous Previous
 
Next Next
New Post 5/9/2008 2:44 PM
User is offline Mike Riley
245 posts
9th Ranked


Two Template Questions 

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 3:17 PM
User is offline Mike Riley
245 posts
9th Ranked


Re: Two Template Questions 

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 7:33 AM
User is offline Steve Fabian
1498 posts
6th Ranked








Re: Two Template Questions 

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


Steve Fabian
Gooddogs.com
Sit, Stay, Code ... Good boy!
 
New Post 5/12/2008 1:26 PM
User is offline Mike Riley
245 posts
9th Ranked


Re: Two Template Questions 
Modified By Mike Riley  on 5/12/2008 5:20:49 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 Previous
 
Next Next
  Forum  DotNetNuke® Pro...  Repository Modu...  Two Template Questions
 


Forum Policy

These Discussion Forums are dedicated to the discussion of the DotNetNuke Web Application Framework.

For the benefit of the community and to protect the integrity of the project, 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 DotNetNuke.
2. Discussion or promotion of DotNetNuke product releases under a different brand name are strictly prohibited.
3. No Flaming or Trolling.
4. No Profanity, Racism, or Prejudice.
5. Site Moderators have the final word on approving/removing a thread or post or comment.
6. English language posting only, please.

 


Smart-Thinker
DNN Modules for Social Networks for as low as $69 for 6 modules! We also maintain the DotNetNuke Directory - http://DNNDir.com
www.smart-thinker.com
DNN Photo Gallery
Complete Photo Gallery Management!
www.dnnPhotoGallery.com
R2i - Delivering Serious DNN Services & Solutions
Award Winning Design, Skin construction, Custom Modules and Consulting Services for the Enterprise organization. R2i is the DNN:Map module Project Lead and one of the largest DNN service providers with offices in New York City, Virginia and Baltimore.
www.bi4ce.com

DotNetNuke Corporation   Terms Of Use  Privacy Statement
DotNetNuke®, DNN®, and the DotNetNuke logo are trademarks of DotNetNuke Corporation
Hosted by MaximumASP