inboundnow / retired-landing-pages

Create landing pages for your WordPress site. Monitor and improve conversion rates, run A/B split tests, customize your own templates and more.
http://www.inboundnow.com/landing-pages/
GNU General Public License v2.0
4 stars 2 forks source link

Ideas to clean up config.php for easier templating #216

Closed DavidWells closed 9 years ago

DavidWells commented 9 years ago

Can we get rid of these config blocks: https://github.com/inboundnow/landing-pages/blob/53e214b8bcc036eb20531794637b24ba5111ec72/templates/half-and-half/config.php#L24-L40 ?

Also, did we ever use https://github.com/inboundnow/landing-pages/blob/53e214b8bcc036eb20531794637b24ba5111ec72/templates/half-and-half/config.php#L8 the custom hook? if not, lets kill it. It's confusing to even myself =P

Is there a way to clean up the actual config to just have the template info, then the register fields? ( here https://github.com/inboundnow/landing-pages/blob/53e214b8bcc036eb20531794637b24ba5111ec72/templates/half-and-half/config.php#L11-L21 )

Like instead of

$key = lp_get_parent_directory(dirname(__FILE__));
$lp_data[$key]['info'] =
array(
    'data_type' => 'template',
    'version' => "2.0.1",
    'label' => "Half and Half",
    'category' => '2 column layout',
    'demo' => 'http://demo.inboundnow.com/go/half-and-half-lander-preview/',
    'description'  => 'Half and Half is a template with two content areas on each side of the page. One side has your conversion area and the other your content on the page.' // template description
);

We just have:

$config = array(
    'data_type' => 'template', // this data type seems redundant. Can we remove?
    'version' => "2.0.1",
    'label' => "Half and Half",
    'category' => '2 column layout',
    'demo' => 'http://demo.inboundnow.com/go/half-and-half-lander-preview/',
    'description'  => 'Half and Half is a template with two content areas on each side of the page'
);
// then acf register fields below
atwellpub commented 9 years ago

These:

https://github.com/inboundnow/landing-pages/blob/53e214b8bcc036eb20531794637b24ba5111ec72/templates/half-and-half/config.php#L24-L40

Yes we can if we build a special handler for ACF powered templates. It will take some careful research and implementation. We can't hide all these all together yet because of all the people with custom template builds.

atwellpub commented 9 years ago

@DavidWells

Templates now, if powered by ACF, and marked here: https://github.com/inboundnow/landing-pages/blob/feature/Template_conversions_to_acf/templates/countdown-lander/config.php#L24

Have the unused UI elements automatically removed instruction field automatically added.

See: https://github.com/inboundnow/landing-pages/commit/dcbe051c140836d964c2b0c6dd34c17b0f9eb37a

DavidWells commented 9 years ago

I like that the config is cleaner. Nice work.

On Wed, Sep 2, 2015 at 5:39 PM, Hudson Atwell notifications@github.com wrote:

@DavidWells https://github.com/DavidWells

Templates now, if powered by ACF, and marked here:

https://github.com/inboundnow/landing-pages/blob/feature/Template_conversions_to_acf/templates/countdown-lander/config.php#L24

Have the unused UI elements automatically removed instruction field automatically added.

See: dcbe051 https://github.com/inboundnow/landing-pages/commit/dcbe051c140836d964c2b0c6dd34c17b0f9eb37a

— Reply to this email directly or view it on GitHub https://github.com/inboundnow/landing-pages/issues/216#issuecomment-137282794 .

DavidWells commented 9 years ago

do we need this? https://github.com/inboundnow/landing-pages/blob/feature/Template_conversions_to_acf/templates/countdown-lander/config.php#L18 seems like overkill.

Maybe we can use that data_type to specify if the template is an ACF template or not. Then we don't need the additional parameter on the config.

Like:

$lp_data[$key]['info'] = array(
'data_type' => 'acf', // Template Data Type
'version' => "1.0.5", // Version Number
'label' => __( 'Countdown Lander' , 'landing-pages' ), // Nice Name
'category' => 'Countdown,1 column', // Template Category
'demo' => 'http://demo.inboundnow.com/go/countdown-lander/', // Demo Link
'description'  => __( 'Coundown Lander provides a simple sharp looking
countdown page.' , 'landing-pages' ), // template description
);

On Wed, Sep 2, 2015 at 5:55 PM, David Wells david@inboundnow.com wrote:

I like that the config is cleaner. Nice work.

On Wed, Sep 2, 2015 at 5:39 PM, Hudson Atwell notifications@github.com wrote:

@DavidWells https://github.com/DavidWells

Templates now, if powered by ACF, and marked here:

https://github.com/inboundnow/landing-pages/blob/feature/Template_conversions_to_acf/templates/countdown-lander/config.php#L24

Have the unused UI elements automatically removed instruction field automatically added.

See: dcbe051 https://github.com/inboundnow/landing-pages/commit/dcbe051c140836d964c2b0c6dd34c17b0f9eb37a

— Reply to this email directly or view it on GitHub https://github.com/inboundnow/landing-pages/issues/216#issuecomment-137282794 .