Brand new. This stack can be used to create a basic, low-security retrieval or login system for a website. It's a good little solution for those of you who want a user to enter a reference number or passcode, and then get forwarded to a particular page or file. For example, if you are a photographer and you provide your clients with a passcode like jimsusanwedding11, they can enter that passcode in the box and get forwarded through to a gallery page called jimsusanwedding11.html on your website. In another example, you could use the Lookup stack to retrieve forms or PDF documents from an online cloud, based on the document reference number entered. Or if you provide customers with coupon codes, they can enter them in the box and get forwarded to a particular page on your website with special discounts listed.
Lookup Don't worry, there's no spider on the ceiling.
Important As mentioned already, this stack provides a low-security login system. Although passcodes and full page addresses are not presented in the source code, it would still be possible to 'guess' the page address and gain access to unencrypted pages or files. If you need a more robust login solution which physically encrypts pages, then consider something like Lockdown, WeaverBox or WeaverFM instead.
PDF documentType example in the input box below and click download, to retrieve a secret PDF file from DropBox.
In this example the path in the Lookup settings was set to http://dl.dropbox.com/u/422052/stacks4stacks/test/ and the file extension was set to .pdf. When you type the actual file name in the box above, it completes the URL and provides a direct link to the PDF file.
Password boxType secret in the input box below and click open.
This example uses the password input type, which is available for selection in the Lookup input type settings. Typed passcodes are entered in the form of a password, and are obfuscated by dots. Additionally if the web browser has any keychain or password utilities available (like 1Password), the user will be prompted to save the passcode.
PhotographsType mypicture.jpg or mypicture.gif in the box below and click view image.
In this example, the file extension setting in the Lookup settings comprises of a blank space ( ), so an end user can decide themselves whether to open the JPG or GIF version of the image.
Coupon CodesType discount16 in the box below.
If a successful discount code is entered, the customer will get redirected to the discount16 page on your website.
As this page demonstrates, you can safely use multiple Lookup stacks on a single page. The Lookup stack is also compatible with the @import function in PlusKit, so you can import Lookup stacks into non-stack pages. Some people prefer to use browser defaults for styling forms in web pages, however several dozen settings are included for you to apply custom styling to both the input field and submit button. Options also exist to change the input box placeholder text and the submit button title. Although the Lookup stack uses PHP code, the page hosting the form field and submit button can be left as a regular HTML page, if you prefer. If you opt to have the input box displayed as a password field, keychain software like 1Password will offer to save the passcode for you.
- Once installed, drag and drop a Lookup stack into your page
- In the Base URL box, enter the initial URL like http://www.example.com/folder/
- If a file extension, forward-slash character or other content needs to be appended after the value a user types in the box, then enter this in the extension box.
- In the Input Type menu, choose whether to use a standard text box ot a password box. Both work in a similar way, except typed characters are replaced with dots, when using the password box option.
- The input box placeholder text and the submit button text can both be changed, if required.
- Optionally, you can change the colour and style of both the input box and submit button, using the settings provided
Customising the error messageIf a user mistypes the wrong passcode, a simple error message is displayed informing them of their mistake and providing a "try again" button. This message gets generated by the PHP code, based on whether a matching URL can be found or not. To edit the error message, go to Finder and click Go > Go to folder from the menu. In the window that opens, type the following:
Then click Go.
In the new window that opens, right-click on your Lookup.stack file, and select Show Package Files. Click on Contents, then click on Resources. Open the process.php file in your favourite code editor, and scroll down towards the bottom, where you will see a comment and the existing HTML error code. Change the text to whatever you want and enter custom code or scripts. Save the file when done and restart RapidWeaver for the changes to take place in your stack. If you have problems finding or customising this file, please get in contact. Unfortuantly Stacks does not currently allow us to write code or content into an asset like process.php, so the editing has to be done manaully.