Posted on

Mobot Two

Woah, I just found and bounced an original concept, totally unpolished track, I wrote 10 years ago! Thats before I learned to DJ, before I fell in love with Raags and before I knew what side chaining and compression are! Mobot Two. Its quite terrible.

Posted on

Objx Theme Support

The Objx Theme Support sidebar provides quick options for theme developers to tap into.

Hiding the Title

I often want to remove the title on certain pages, without too much fuss. So, I added the Hide Title option (metakey ‘objx_theme_no_title‘), which you can use in your theme code.

To get this to work, you have to modify your themes template pages.

Custom Side Bars

Read more about custom side bars…. here.

Posted on

Objx Model Tokens, embedding dynamic data in your pages, without writing code.

Open source plugins like Advanced Custom Fields and xxxx are great for quickly creating and editing new objects types within the WordPress’s Admin interface. But how can we easily display those custom object types, without writing custom php theme code?

Objx Model Tokens embed dynamic data into your page.

There are already several query blocks out there that allow you to fetch custom query posts and display them in cards, or a grid, or a list. Unfortunately, the options for visual display are usually quite limiting in such blocks. The is no real way to truly customize the visual layout and specify what information should be displayed, especially when dealing with your own custom post types. Objx Model Tokens select information from your post and allow you to insert that information where you want, styled how you want!

The Objx QueryLoop

The content inside an objx QueryLoop is referred to as its template, and provides the objxItem token to select information for display from the currently iterated post.

{{objxItem:my_custom_field_name}}

Inside a query loop, we can use the objxItem token to refer to the currently looped item

Post Tokens

Since all custom post types are subclasses of Post, the following tokens are always available, no matter what custom post type we are referencing.

Working with Metadata

We can select and display any registered meta data value with the meta keyword.

objxItem:meta:custom-meta-key-name

Form Tokens

The Objx Form block provides the objxForm token (only available from within a form block) with the following keys:

  • objxForm:msg – Feed back message from the server, upon submission of the form
  • objxForm:loading – Used to display a spinner while the form is submitting
  • objxFormItem:custom-keys – Upon submission, the returned object is available using objxFormItem:

objxForm keys

Posted on

Extending the Scheduler Interface

Similar to WordPress’s Admin Tables, the Scheduler table is also extendable. Using the objxMobile_scheduler_attributes filter, we can add extra attributes to the table; Currently, only the extra aux_columns attribute is available). This code should go in your functions.php of your child theme.

In this example, I add a new Column “Assessment”, and if the client of the appointment has a special metakey present, include a link to said assessment.

objxMobile_scheduler_attributes Filter

Here we specify a single custom column with the aux_columns key, and indicate assessmentHtml as the key to use on the displayed appointment object.

add_filter('objxMobile_scheduler_attributes', 'my_scheduler_atts_filter', 10, 1);
function my_scheduler_atts_filter($attributes){
   $attributes['aux_columns'] = [['label'=>'Assessment', 'key'=>'assessmentHtml']];
}

objxMobile_appointments Filter

Using this filter we get the client object for the appointment, check for our custom metakey, and then add it to the appointment using our assessmentHtml key.

add_filter('objxMobile_appointments', 'my_appointments_filter', 10, 1);
function my_appointments_filter($appointments){
   $attributes['aux_columns'] = [['label'=>'Assessment', 'key'=>'assessmentHtml']];
}