Jump to content
Ketarin forum

Placeholder Examples (with new 'options' feature)


CybTekSol
 Share

Recommended Posts

These are some of the 'placeholders' that I am currently using within my custom templates. Ketarin users can modify them to suit their particular needs and situations. These examples include the use of the new 'options' feature which provides the capability of incorporating 'drop-down' style selection menus. IMHO, this ability has provided a dramatic improvement in the power and flexibility of 'placeholders'. Use these at your own risk as some of these are still be tested! ;)

 

Note: 'Placeholder options' require Ketarin 1.0.6b3 or newer.

 

Hint: If you place an additional 'pipe symbol' ( | ) at the end of the 'options' entries, you can easily blank/null an existing value with the 'drop-down' menu for those entries that can be empty.

 

Warning: Be especially careful with the 'commands' as they are for MY setup... THEY MUST BE MODIFIED for YOUR SETUP! Also, refer to 'Flo's primary Ketarin tutorial' in this section for other command options such as 'background execution' by adding the ampersand ( & ) to the end of the command...

 

Examples of use within template tags:

<DownloadBeta><placeholder name="Download Beta Versions?" value="Default" options="Default|Avoid|AlwaysDownload" /></DownloadBeta>

<CheckForUpdatesOnly><placeholder name="Check for Updates Only?" value="false" options="false|true" /></CheckForUpdatesOnly>

<VariableChangeIndicator><placeholder name="Change Indicator?" value="" options="{version}|" /></VariableChangeIndicator>

<ExclusiveDownload><placeholder name="Exclusive Download?" value="false" options="false|true" /></ExclusiveDownload>

<ExecuteCommand><placeholder name="Execute Command AFTER Downloading?" value="" options="copy /y "{file}" "{archive_folder}\{category}"|copy /y "{file}" "{install_cache_folder}"|copy /y "{file}" "{shared}\{category}"|{run_7-zip} e "{file}" -aoa -o"{install_cache_folder}{appname:replace: :_}_v{version}"|{run_ue} "{file}" "{install_cache_folder}{appname:replace: :_}_v{version}"|{run_7-zip} e "{file}" -aoa -o"{nirsoft_utilities_root_folder}{appname:replace: :_}"|{run_7-zip} e "{file}" -aoa -o{sysinternals_suite_root_folder}|" /></ExecuteCommand>

<ExecutePreCommand><placeholder name="Execute Command BEFORE Downloading?" value="copy /y "{file}" "{archive_folder}\{category}"" options="copy /y "{file}" "{archive_folder}\{category}"|move /y "{root_folder}\{category}\{appname:replace: :_}*.*" "{archive_folder}\{category}"|move /y "{target}\{category}\{appname:replace: :_}*.*" "{archive_folder}\{category}"|del /q "{root_folder}\{category}\{appname:replace: :_}*.*"|del /q "{target}\{category}\{appname:replace: :_}*.*"|" /></ExecutePreCommand>

<Category><placeholder name="Category?" value="New" options="Antivirus|CD-DVD|Data|Distros|Drivers|Education|Engineering|Finance|Games|Internet|Media|Miscellaneous|New|Office|Personal Productivity|Programming|Security|Test|Text|Utilities" /></Category>

<DeletePreviousFile><placeholder name="Delete Previous Version?" value="true" options="false|true" /></DeletePreviousFile>

<TargetPath><placeholder name="Save to Location?" value="{root_folder}\{category}\" options="{root_folder}\{category}\|{target}\{category}\" /><placeholder name="Rename Rule Convention?" value="{appname:replace: :_}_v{version}.{url:ext}" options="{appname:replace: :_}_v{version}.{url:ext}|{appname:replace: :_}_install_v{version}.{url:ext}|{appname:replace: :_}_installer_v{version}.{url:ext}|{appname:replace: :_}_setup_v{version}.{url:ext}|{url:basefile}_v{version}.{url:ext}" /></TargetPath>

<TargetPath><placeholder name="Save to Location?" value="{root_folder}\{category}\" options="{root_folder}\{category}\|{target}\{category}\" /><placeholder name="Rename Rule Convention?" value="{appname:replace: :_}_v{f:yyyy}-{f:MM}-{f:dd}.{url:ext}" options="{appname:replace: :_}_v{f:yyyy}-{f:MM}-{f:dd}.{url:ext}|{appname:replace: :_}_install_v{f:yyyy}-{f:MM}-{f:dd}.{url:ext}|{appname:replace: :_}_installer_v{f:yyyy}-{f:MM}-{f:dd}.{url:ext}|{appname:replace: :_}_setup_v{f:yyyy}-{f:MM}-{f:dd}.{url:ext}|{url:basefile}_v{f:yyyy}-{f:MM}-{f:dd}.{url:ext}" /></TargetPath>

<Name><placeholder name="Application Name?" value="New App Download" /></Name>

Miscellaneous Examples:

<placeholder name="Recurring 'Anchor String' BEFORE and NEAR Version Number? (Example: Version)" value="Version" options="Current|Current Version|Current Version:|Latest|Latest Version|Latest Version:|Version|Version:" />

<placeholder name="Recurring 'Anchor String' BEFORE and NEAR URL? (Example: Download)" value="Download" options="Current|Current Version|Current Version:|Download|Download:|Download Now|Download Now:|Latest|Latest Version|Latest Version:|Link|Link:" />

<placeholder name="Extension of Desired Download? [Example: exe or zip]" value="exe" options="exe|7z|zip|zip2|arc|bz|bz2|bzip|gz|gzip|jar|lha|lzh|lzw|pak|rar|sit|sit!|sit5|sitd|sithqx|sitx|tz|wsz|cab|msi|bin|img|iso|xpi|pbp" />

<placeholder name="Desired SourceForge Mirror? [internap, voxel, etc.]" value="voxel" options="freefr|internap|internode|kent|osdn|ovh|softlayer|superb-east|superb-west|transact|ufpr|voxel|waix" />

<placeholder name="Policy Agreement Required?" value="no" options="no|yes" />

<placeholder name="Operating System Preference? [Windows OR Linux OR MacOSX]" value="Windows" options="Windows|Linux|MacOSX" />

As you can see from these examples, templates can be greatly enhanced with the clever use of 'placeholder options'... practically limited to one's own ingenuity and creativity! :D

 

MODIFIED: June 4th, 2009 to include quotes ( " ) (or " specifically) around the variable {file} as used in the 'command placeholders' above to accommodate the changes for Ketarin 1.0.7... They can be removed if you do not have spaces a particular file's path (or use an older version of Ketarin).

Edited by CybTekSol
Link to comment
Share on other sites

  • 2 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.