CMS Development

ktorti
Member

Export secondary blog

SOLVE

I used this bit of code to preview and export our primary blog, but we have a secondary blog I need to export as well. Is there a way to modify this to preview and export the secondary one?

 

{% if is_listing_view %} "post_title","post_slug","post_date","post_content","post_thumbnail","post_author","post_category",<br>
{% for content in contents %} "{{ content.name|forceescape }}","{{ content.slug|forceescape|replace('blog/', '') }}","{{ content.publish_date_localized|forceescape }}","{{ content.post_body|replace('"','""')|forceescape|escape_jinjava }}","{{ content.featured_image }}","{{ content.blog_post_author }}","{{ content.topic_list|forceescape|replace('[', '')|replace(']', '') }}"<br>
{% endfor %} {% endif %}
0 Upvotes
1 Accepted solution
piersg
Solution
Key Advisor

Export secondary blog

SOLVE

Hi @ktorti,

 

Because 'contents' in a blog template is a predefined sequence of content that contains all the posts contained in that blog, you could just apply that template to the secondary blog in the blog settings, or add your code to the secondary blog's template.

 

Or, if you want to export all blog posts with tags and blog URLs related to the blog posts, you can go to Reports > Analytics Tools > Website Analytics.  Select "Blog posts" as the "Page Type" (in the upper left corner), click Filter blog posts > Blog > name of the blog you want, then click the <Export> link (in the upper right corner), select " xlsx" as the "File Format". This export will get a complete report of blog posts, including name, author, URL, tags, dates, campaigns, etc.

View solution in original post

1 Reply 1
piersg
Solution
Key Advisor

Export secondary blog

SOLVE

Hi @ktorti,

 

Because 'contents' in a blog template is a predefined sequence of content that contains all the posts contained in that blog, you could just apply that template to the secondary blog in the blog settings, or add your code to the secondary blog's template.

 

Or, if you want to export all blog posts with tags and blog URLs related to the blog posts, you can go to Reports > Analytics Tools > Website Analytics.  Select "Blog posts" as the "Page Type" (in the upper left corner), click Filter blog posts > Blog > name of the blog you want, then click the <Export> link (in the upper right corner), select " xlsx" as the "File Format". This export will get a complete report of blog posts, including name, author, URL, tags, dates, campaigns, etc.