HTML
Learn how to get started building an Instagram feed with HTML Attributes.
Last updated
Learn how to get started building an Instagram feed with HTML Attributes.
Last updated
Building a social feed with HTML is straightforward and efficient. Our advanced attribute system powers your feeds, allowing you to seamlessly integrate attributes directly into your own structure.
Key Features:
Attributes: Feeds are built by adding attributes directly to your HTML structure
Attributes Table: You can view all available attributes in the attributes table.
Flexability: All attributes are optional (eg. caption, avatar), only the feed wrapper and post wrapper are required.
From your FeedSpring dashboard, select the "Connect New Feed" option and follow the steps to create a new feed. For more detailed getting started instructions, view our documentation page.
Include the FeedSpring library in your HTML file:
FeedSpring works by adding custom attributes to your HTML elements. These attributes define how the feed and its content are structured and displayed. Here’s a detailed example:
In this example, the feedspring
attribute is used to wrap the entire feed and individual posts, while feed-field
attributes are used to specify the content to display within each post.
The Feed Wrapper specifies where the feed will be rendered on the page and can be added to any element that will enclose the entire feed. We recommend adding a new <div>
block to wrap your feed and applying the attribute directly to this element.
Add the attribute name="feedspring"
andvalue="YOUR-UNIQUE-ID"
to the <div>
block
Your unique feed ID is available on the feed setup page within the app and can be copied directly from there.
The Post Wrapper contains the main content of a post and is nested inside the Feed Wrapper. This is where you'll add any layout elements related to your posts, such as captions or timestamps. To create the Post Wrapper, add the following attribute to a <div>
block that will enclose your post. You can duplicate this block for as many posts as you wish to display.
Simply add the attribute name="feedspring"
andvalue="post"
The following attributes can be added to your layout to start displaying their respective data.
Post Specific: Some attributes can only be added to structure inside the post wrapper, these attributes are labeled as 'Post Attribute' above. All other attributes can be placed anywhere inside your feed wrapper.
Field | Attribute Name | Attribute Value | Post Attribute* |
---|---|---|---|
Image | feed-field | img | |
Link | feed-field | link | |
Title | feed-field | title | |
Timestamp | feed-field | timestamp | |
Tag | feed-field | tag | |
Avatar | feed-field | avatar | |
Name | feed-field | name | |
Bio | feed-field | bio | |
Profile Link | feed-field | profile-link | |
Follower Count | feed-field | follower-count | |
Location | feed-field | location |
Building your feed is super simple, add attributes detailed below to your structural content and publish your site to see the feed in action.
To display the image, add the following attribute to a <img> element on your page. Since this attribute is related to a post, it should be placed within an element that has the Post Wrapper.
name="feed-field"
andvalue="img"
To link to the original post, add the following attribute to a <link> element on your page. Since this attribute is related to a post, it should be placed within an element that has the Post Wrapper.
name="feed-field"
andvalue="link"
To display the title, add the following attribute to a <text> element on your page. Since this attribute is related to a post, it should be placed within an element that has the Post Wrapper.
name="feed-field"
andvalue="title"
To display the timestamp, add the following attribute to a <text> element on your page. Since this attribute is related to a post, it should be placed within an element that has the Post Wrapper.
name="feed-field"
andvalue="timestamp"
Timestamp Format: We also provide options to format the timestamp to suit your own requirements. Please review our timestamp documentation to learn more about this.
To display the tag, add the following attribute to a <text> element on your page.
name="feed-field"
andvalue="tag"
To display the avatar, add the following attribute to a <img> element on your page.
name="feed-field"
andvalue="avatar"
To display the name, add the require following to a <text> element on your page.
name="feed-field"
andvalue="name"
To display the bio, add the following attribute to a <text> element on your page.
name="feed-field"
andvalue="bio"
To link to the profile, add the following attribute to a <link> element on your page.
name="feed-field"
andvalue="profile-link"
To display the follower count, add the following attribute to a <text> element on your page.
name="feed-field"
andvalue="follower-count"
To display the location, add the following attribute to a <text> element on your page.
name="feed-field"
andvalue="location"
FeedSpring provides a range of advanced options to further customize your feeds and enhance their functionality. Explore the following sections to discover how to implement these features into your builds:
Learn about additional options you can add to your feeds, such as language tags and more.
Learn how to create a seamless loading experience for your feeds using placeholders.
Learn how to create a dynamic feed, using the layout of a single post.
Learn how to adjust timestamp format to suit exactly what you want for your feed.
View our collection of coded solutions built to help you solve problems with simple CSS/JS