Skip to content

Instantly share code, notes, and snippets.

@nathanbrauer
Last active December 20, 2015 16:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nathanbrauer/649d9e7a4315302ddee0 to your computer and use it in GitHub Desktop.
Save nathanbrauer/649d9e7a4315302ddee0 to your computer and use it in GitHub Desktop.
---
Name: custom_routes
---
Director:
rules:
'example//$Action/$ID/$OtherID' : 'Spider_Controller',
<!--?xml version="1.0"?-->
<add>
<% loop Entries %>
<doc>
<field name="sfdcid"><![CDATA[$AbsoluteLink]]></field>
<field name="title"><![CDATA[$Title.XML]]></field>
<field name="summary"><![CDATA[$Description.XML]]></field>
<field name="body"><![CDATA[$Content.XML]]></field>
<field name="lastmodified"><![CDATA[$LastEdited.format(Y-m-d\TH:i:s.z\Z)]]></field>
<field name="keywords"><![CDATA[$Keywords.XML]]></field>
<% if SolrTopCategory %><field name="top_category"><![CDATA[$SolrTopCategory]]></field><% end_if %>
<% if SolrChildCategory %><field name="child_category"><![CDATA[$SolrChildCategory]]></field><% end_if %>
<% if SolrDCategory %><field name="dcategory"><![CDATA[$SolrDCategory]]></field><% end_if %>
<% if SolrDCategories %>
<% loop SolrDCategories %>
<field name="dcategory"><![CDATA[$Title.XML]]></field>
<% end_loop %>
<% end_if %>
</doc>
<% end_loop %>
</add>
<?php
class Spider_Controller extends ContentController {
static $allowed_actions = array(
'CommunityResources',
);
function init(){
parent::init();
}
function index() {
if (!Member::currentUser()) die("<h1>You're not logged in.</h1>");
echo "<h1>Available tasks:</h1><ul>";
foreach (self::$allowed_actions as $action) {
$clickable = trim(preg_replace('/(?<=\\w)(?=[A-Z])/'," $1", $action));
echo "<li><a href='/spider/$action'>$clickable</a></li>";
}
echo '</ul>';
}
function CommunityResources() {
var_dump(Versioned::current_stage());
Versioned::set_reading_mode('live');
var_dump(Versioned::current_stage());
$Resources = ResourcePage::get()->filter('ShowInSearch', 1)->exclude('ClassName', 'ResourceType_Event')->sort('Created DESC');
$Resources->toArray();
return $this->renderWith(
array('SolrSpider'),
array(
'Entries' => $Resources
)
);
}
}
<?xml version="1.0"?>
<doc>
<field name="sfdcid"><![CDATA[http://nathan.dev.www.example.com/ebooks/the-inbound-marketers-guide-to-seo-and-ppc/]]></field>
<field name="title"><![CDATA[The Inbound Marketers Guide to SEO and PPC]]></field>
<field name="summary"><![CDATA[Achieving higher placement within the search engines requires a hybrid of math, art, science, and creativity. Download this ebook to learn all about how to optimize SEO and PPC for inbound marketing.]]></field>
<field name="body"><![CDATA[&lt;p&gt;Achieving higher placement within search engines requires a hybrid of math, art, science, and creativity. If search engine optimization (SEO) were simple, everyone would rank at the top of the search results, which obviously isn’t realistic. However, SEO and Pay-Per-Click (PPC) campaigns are key to acquiring inbound traffic to your website.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Download this ebook and learn how to optimize your PPC and SEO efforts for inbound marketing. You will learn:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;What SEO has to do with inbound marketing&lt;/li&gt;
&lt;li&gt;Where inbound marketing lives&lt;/li&gt;
&lt;li&gt;The math involved in SEO and PPC&lt;/li&gt;
&lt;li&gt;The art and science of inbound marketing&lt;/li&gt;
&lt;li&gt;The anatomy of a paid search campaign&lt;/li&gt;
&lt;li&gt;And much more!&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;Also learn how to become an SEO expert by attending the right conferences and subscribing to the right RSS feeds.&lt;/p&gt;]]></field>
<field name="lastmodified"><![CDATA[2013-07-12T11:20:13.192Z]]></field>
<field name="keywords"><![CDATA[eBook,eBooks,Inbound Marketing]]></field>
<field name="top_category"><![CDATA[RESOURCE_CENTER]]></field>
<field name="child_category"><![CDATA[eBook]]></field>
<field name="dcategory"><![CDATA[Inbound Marketing]]></field>
<field name="dcategory"><![CDATA[Inbound Marketing]]></field>
</doc>
<doc>
<field name="sfdcid"><![CDATA[http://nathan.dev.www.example.com/ebooks/new-resource-2/]]></field>
<field name="title"><![CDATA[New Resource]]></field>
<field name="summary"><![CDATA[]]></field>
<field name="body"><![CDATA[]]></field>
<field name="lastmodified"><![CDATA[2013-06-25T13:12:53.175Z]]></field>
<field name="keywords"><![CDATA[]]></field>
<field name="top_category"><![CDATA[RESOURCE_CENTER]]></field>
</doc>
<doc>
<field name="sfdcid"><![CDATA[http://nathan.dev.www.example.com/ebooks/the-doctor-will-see-you-now-lessons-for-marketing-in-the-healthcare-industry/]]></field>
<field name="title"><![CDATA[The Doctor will See You Now: Lessons for Marketing in the Healthcare Industry]]></field>
<field name="summary"><![CDATA[Marketing in the healthcare industry can be difficult, largely due to the complexity of engaging with physicians. Not only do physicians have no time, but their profession is changing rapidly. Download this ebook to see how to leverage marketing automation and digital marketing in the healthcare industry.]]></field>
<field name="body"><![CDATA[&lt;p&gt;Marketing in the healthcare industry can be difficult, largely due to the complexity of engaging with physicians — healthcare’s primary target audience. Physicians famously have no time and their profession is rapidly, and often unpredictably, changing. In many industries, the target persona generally does not wake up each morning and wonder whether the government changed the rules for getting paid overnight, for example. Physicians do. Suffice to say that marketing to the healthcare industry can get a bit complex.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Download this ebook and learn how CareCloud, a solution that enables medical practices to run their operations in the cloud, has leveraged tools like marketing automation to sharpen their marketing and accelerate their sales cycles.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Techniques discussed include:&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;Landing page optimization&lt;/li&gt;
&lt;li&gt;Email automation and follow-through&lt;/li&gt;
&lt;li&gt;Lead Nurturing and making the sale&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;The demands placed on doctors are many and it is time to evolve an industry where marketing used to mean faxes and visits from pharma reps and bring it to the forefront of its marketing peers.&lt;/p&gt;]]></field>
<field name="lastmodified"><![CDATA[2013-06-25T14:22:30.175Z]]></field>
<field name="keywords"><![CDATA[eBook,eBooks,Marketing Automation Success Center]]></field>
<field name="top_category"><![CDATA[RESOURCE_CENTER]]></field>
<field name="child_category"><![CDATA[eBook]]></field>
<field name="dcategory"><![CDATA[Marketing Automation Success Center]]></field>
<field name="dcategory"><![CDATA[Marketing Automation Success Center]]></field>
</doc>
</add>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment