Archive Pro Matic Highlight Class

Introducing a new attribute for Archive-Pro-Matic: highlight
highlight will accepts the following values:

  • current-year
  • active-year

Demos

We have added a bit of css to highlight each of the classes:

.current-year {
border-left: 2px solid red;
}

.active-year {
border-left: 2px solid blue;
}

current-year

Assigning ‘current-year’ as the value of the highlight attribute will add a current-year class to the current year in the list:
[archives type="yearly" cat_id="4" limit="5" highlight="current-year"/]

active-year

Assigning ‘active-year’ would only be used on the archive page itself. To see this in action, first visit the an archive page, say 2014 and on that page place an archive list using the sidebar widget or following shortcode.

[archives type="yearly" cat_id="4" limit="5" highlight="active-year"/]

Print-O-Matic and WordPress Charts

Here is an example of using Print-O-Matic to print a WordPress Chart using wp-charts

First, the chart:
[wp_charts title=”mypie” type=”pie” animation=”false” align=”alignright” margin=”5px 20px” data=”10,32,50,25,5″]

Now we make a print button:

It seems we need to wrap the chart shortcode in a div so we can target that div and include it’s related javascript.
Still not. maybe we also need to include the chart js on the page?
Nope. It seems the HTML Canvas element is not cloning it’s content that was generated by the javascript… hmmm.

Archive-Pro-Matic Alpha List Subheadings

Archive-Pro-Matic version 1.0.4 introduces two new attributes: alpha_headings and alpha_tag

[archives type="alpha" cat_id="4" limit="10" alpha_headings="true"/]

[archives type="alpha" cat_id="4" limit="10" alpha_headings="true" alpha_tag="strong"/]

Collapse-O-Matic Inline Trigger with Block Target

The roll-your-own method does not work easily, as we have no way of targeting only the expanded state.

<span title="this trigger" class="collapseomatic" id="testme">this trigger</span>
<span class="collapseomatic_content" id="target-testme">hidden content</span>

This is an example of some text that has a trigger placed inline, meaning that the trigger does not break the flow of the text. However, when this triggerhidden content is clicked and the target is expanded, the target would break the paragraph as a display: block element. Naturally, when the element is collapsed, the inline flow returns.

This is an example of some text that has a trigger placed inline, meaning that the trigger does not break the flow of the text. However, when this trigger

hidden content

is clicked and the target is expanded, the target would break the paragraph as a display: block element. Naturally, when the element is collapsed, the inline flow returns.

Limited Time Offer Demo

This is an example of how a limited time offer would work in conjunction with content in a collapse-o-matic expand element.

This demo uses T(-) Countdown Control with a cookie that tracks when the offer expires for each unique visitor. Once the countdown reaches zero, T(-) Countdown Events will remove any special offer items.

For this demo, we’ll set the special timer for just two minutes. The offer will then be removed for 24 hours, and then after the 24 hours are past, the offer will reset.

Days
0
0
Hours
0
0
Minutes
0
2
Seconds
0
0
Details
this is where the details of the special are presented

T(-) Countdown Control – Separating the Time Units

Normally a countdown groups the units of time (weeks, days, hours, minutes and seconds) into a single countdown unit. But what if you wanted to break out these units and have them displayed on different parts of the page?

Step One. We will need to add a new attribute that tells the countdown NOT to display any of the digits. This way all the countdown scripts and details are still loaded, but the countdown is not displayed. Something like:

[tminus cid="123" hidden="true" style="cloud-city"/]

Step Two. A new shortcode will need to be created for displaying the time unit. We will need to know the countdown id (cid) the time unit to be displayed, and the style to be used, if other than the default style set up on the plugin settings. If a custom style is used it must be defined in both the countdown and the units like so:

[tminus_digit cid="123" unit="hours" style="cloud-city"/]

The final set will be to modify the countdown script to locate the time units, even if they are not wrapped in a countdown dashboard.

Let’s get started.

Here is a hidden countdown:

Now we add all the digits, starting with weeks:

Weeks
0
0

Days:

Days
0
0

Hours:

Hours
0
0

Minutes:

Minutes
0
2

Seconds:

Seconds
0
2

Print-Pro-Matic: Add PDF to Print Page

The following is an example of how to add a pdf document to be printed along with a target using the new add_print_url attribute.

First, we need a simple target to print:

<div id="print_target">This is the simple print target for the page</div>

Now, we simply add our print-me shortcode and use the add_pdf_url attribute to include a pdf document to be printed:

[print-me target="#print_target" add_pdf_url="http://spacedonkey.de/wp-content/uploads/2012/06/RomeSweetRome1-8v22.pdf" pause_time="3000"/]

Direct PDF Print

As of version 1.2.6 we have introduced a new shortcode to print-pro-matic, just for printing PDFs.Note: the ability to print pdf files from javascript is currently not supported in FireFox. Therefore the PDF will open in a new tab and the user can print from there.

[[print-pdf pdf_url="http://spacedonkey.de/wp-content/uploads/2012/06/RomeSweetRome1-8v22.pdf"/]]

This will produce a simple button that will print the pdf:
[print-pdf pdf_url=”http://spacedonkey.de/wp-content/uploads/2012/06/RomeSweetRome1-8v22.pdf” /]

The optional attirbutes for the print-pdf shortcode are as follows:
id
The ID attribute will assign a custom ID to the button. If no ID is assigned a random id will be assigned.

title
The title attribute will assign the text of the print button. If no title is assigned, the button will have the tex of: ‘Print PDF’

class
The class attribute will assign the button a custom class.

tag
The tag attribute will change the trigger element from the default button to, say a div. For example:

[[print-pdf pdf_url="url_to_pdf" tag="div"/]]

img_url
The img_url attribute is used to define the image URL to use as a trigger. Using a trigger image will override standard print trigger, replacing it with the chosen image.

[[print-pdf img_url="url_to_trigger_image"/]]

width
Use the width attribute along with the img_url to define the image width.

height
Use the height attribute along with the img_url to define the image height.

alt
Use the alt attribute along with the img_url to define the image alt value.

Demo of Trigger Image:

[[print-pdf img_url="http://spacedonkey.de/wp-content/uploads/2012/09/ninja_turtles.jpg" alt="" width="600" height="447" pdf_url="http://spacedonkey.de/wp-content/uploads/2012/06/RomeSweetRome1-8v22.pdf"]]
[print-pdf img_url=”http://spacedonkey.de/wp-content/uploads/2012/09/ninja_turtles.jpg” alt=”” width=”600″ height=”447″ pdf_url=”http://spacedonkey.de/wp-content/uploads/2012/06/RomeSweetRome1-8v22.pdf”]

redirect_url
Full url to redirect the user to after either a) the print dialogue closes or b) the pdf is loaded into a new tab (depending on which browser is being used)

[[print-pdf pdf_url="url_to_pdf" redirect_url="http://starwars.wikia.com/wiki/Main_Page"/]]
[print-pdf pdf_url=”http://spacedonkey.de/wp-content/uploads/2012/06/RomeSweetRome1-8v22.pdf” redirect_url=”http://starwars.wikia.com/wiki/Main_Page” title=”Print & Redirect”/]

Putting it all Together

Here we will have a trigger image that redirects on print close:

[[print-pdf img_url="http://spacedonkey.de/wp-content/uploads/2012/09/ninja_turtles.jpg" alt="" width="600" height="447" pdf_url="http://spacedonkey.de/wp-content/uploads/2012/06/RomeSweetRome1-8v22.pdf" redirect_url="http://starwars.wikia.com/wiki/Main_Page" title="Ninja Power"]]
[print-pdf img_url=”http://spacedonkey.de/wp-content/uploads/2012/09/ninja_turtles.jpg” alt=”” width=”600″ height=”447″ pdf_url=”http://spacedonkey.de/wp-content/uploads/2012/06/RomeSweetRome1-8v22.pdf” redirect_url=”http://starwars.wikia.com/wiki/Main_Page” title=”Ninja Power”]