# Spaces “Create a Page” Behavior Guide When asked to **create a page**, output must be a **ready-to-run SQL INSERT** for the `pages` table (or prepared equivalent). ## INSERT Template sql INSERT INTO `pages` ( `type`,`slug`,`title`,`excerpt`,`location`, `content`,`head_content` ) VALUES ( '[type]','[slug]','[title]','[excerpt]','[location]', '[content_json_escaped]','[head_content_json_escaped]' ); * Keep this exact column order. * `content` and `head_content` must be valid JSON strings, SQL-escaped (single quotes doubled or escaped). * Prepared statements preferred. ## Inputs Each request provides: * **type** – page type (`service`, `blog`, etc.) * **slug** – URL slug (auto-generate from title if missing) * **title** – page title * **location** – optional (city/region) ## `head_content` JSON Required fields: json { "title":"SEO-friendly title", "description":"Meta description (110–160 chars).", "keywords":"comma,separated,keywords", "canonical_url":"https://example.com/slug", "og_title":"...","og_description":"...", "og_url":"https://example.com/slug", "og_image":"https://example.com/img.webp", "og_image_alt":"Alt text", "schema":{ /* Organization, Service, or Article schema */ } } get the example and complete data from storage head file in spaces ## `content` JSON Array of section objects: json [{"type":"hero","enabled":true,"data":{...}},{"type":"about","enabled":true,"data":{...}}] Each section: * `type` (string) * `enabled` (bool) * `data` (object with fields) ## Content Rules ### Service pages (`type=service`) Include: `hero`, `about`, `features`, `types`, `process`, `portfolio`, `testimonials`, `contact`, `faq`, optional `pricing`, `cta_banner`. Exclude: `blog`, `single-blog`, `blog-features`. If repeating layouts (e.g., multiple “types” blocks), each must be unique in tone, stats, and CTAs. ### Blog pages (`type=blog` or `single-blog`) Include: `single-blog` (main article), optional `hero`, `blog-features`, `related-posts`, `tags`, `author`, `comments`. Exclude: service-type sections (`types`, `pricing`, etc.) unless small non-promotional links to services. `single-blog` should have intro, headings, lists, images, and conclusion. get the complete structure from main_content file in storage ## SEO & Uniqueness * 100% original, natural writing. * Use target keyword in H1, first 100 words, one H2, and image alt text. * Localize when `location` given (“in Hyderabad” naturally). * Include CTAs like *“Get a free quote”*, *“Book a consultation”* — vary phrasing. * Use short paragraphs, bullets, realistic examples/stats. * Meta description: 110–160 chars. ## Generation Steps 1. Collect inputs (`type`, `slug`, `title`, `location`, optional SEO/images). 2. Build `head_content` JSON from user data or auto-generate SEO fields. 3. Build `content` JSON based on `type`: * **Service:** hero → faq flow, no blog sections. * **Blog:** article structure, no service sections. * Each reused section = unique text & CTA. 4. Validate JSON syntax. 5. Produce final SQL using the template (escaped JSON). 6. Return only the INSERT statement as output. ## Default Images `wordpress.webp`, `office.webp`, `placements.webp`, `redesign.webp`, `regularity.webp`, `responsive.webp`, `seo-hyderabad-blog.webp`, `ssl.webp`, `training.webp`, `training2.webp`, `web-application.webp`, `website-redesign-mistakes.webp`, `white-logo.webp`. ### Example Output sql INSERT INTO `pages` ( `type`,`slug`,`title`,`excerpt`,`location`, `content`,`head_content` ) VALUES ( 'service','web-design-hyderabad','Web Design in Hyderabad', 'SEO-first websites for Hyderabad businesses.','Hyderabad', '[content_json_escaped]', '[head_content_json_escaped]' ); **Summary:** Always generate one valid SQL INSERT for the `pages` table with properly escaped, compact JSON. Choose sections by page type, ensure SEO and uniqueness, and include essential meta + schema fields in `head_content`. # INSTRUCTIONS FOR GENERATION Follow the structure and programming methods used in **index.php**. - Use the **same layout sections** and coding conventions (HTML, PHP, Bootstrap grid). - If new sections are needed, create them. - Use existing structure from service.php — for service pages. - use existing structure from blog.php — for blogs pages. CSS: - Use the existing `custom.css` file for all styles. - If new custom styles are required, write them inline in a `